I want to show SnackBar when the page1 is showing. When the user navigates from page2 to page1.
But i works only from page1 to page2
That ist my Code
class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState(); } class _HomePageState extends State<HomePage> { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text( ' Homepage', ), ), body: Center( child: RaisedButton( ***onPressed: () { Navigator.push(context, BouncyPageRoute3(widget: Page2())); }*** child: Text('go to Page2'), ), ))); } } class BouncyPageRoute3 extends PageRouteBuilder { final Widget widget; BouncyPageRoute3({this.widget}) : super( transitionDuration: Duration(milliseconds: 700), transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) { animation = CurvedAnimation(parent: animation, curve: Curves.ease); return ScaleTransition( scale: animation, alignment: Alignment.center, child: child, ); }, pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) { return widget; }); } When you use the RaisedButton on Page2 to return to HomePage, i want that a SnackBar on HomePage to show
I used also BouncyPageRoute3, that ist for the animation.