Here is my code as a gist ( an interactive version of my code in dartpad.dev )
A quick rundown on what I was trying to do with this app:
I have two page
/
Where I want to type a String in a TextField , which will simultaneously start appearing in theappBar
, and there is another button , which when you press , will take you to another page (Home
Widget ) but with thetext
that you wrote in the/
page. I want this transition to be like a Hero Animation , where the text from theappBar
of/
pageflies
intobody
ofInfo
I was previously Using
Navigator.pushNamed(context, "Info", arguments: {"text": myController.text});
To route to the new page and also pass the text that I want to display over there.And I was able to do it , but even in Profile mode , the animation is too fast
But the answer I got coming from this Question was to use
Navigator.push(
context,
PageRouteBuilder(
transitionDuration: Duration(seconds: 2),
pageBuilder: (_, __, ___) => Page2())
),
But the problem is , the Navigator.push(context, PageRouteBuilder( ... ) )
doesn't let you pass arguments , which I definitely want to be able to do.