To use push with a named route, use RouteSettings argument with the route name . Directly inside Page1 pass the User object ( loggedInUser ) to Page2 within a Navigator. push call and use a RouteSettings arg with your route name ( /page2 ). Navigator.
Read moreHow do you use autoroute Flutter?
Implementation:
Read moreHow do you use autoroute Flutter?
Implementation:
Read moreHow do you pass arguments from one screen to another in Flutter?
Navigate and pass data to the detail screen.
Read moreHow are arguments passed in pushNamed?
To use push with a named route, use RouteSettings argument with the route name . Directly inside Page1 pass the User object ( loggedInUser ) to Page2 within a Navigator. push call and use a RouteSettings arg with your route name ( /page2 ). Navigator.
Read moreHow do you pass arguments from one screen to another in Flutter?
Navigate and pass data to the detail screen.
Read more