Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Added that line before Navigator, but it's still showing me the snackbar after hitting back button. scaffoldKey.currentState.removeCurrentSnackBar(); Navigator.push( context, MaterialPageRoute(builder: (context) => Screen2()) ); scaffoldKey.currentState.showSnackBar(SnackBar(content: Text(' Show me'),)); Commented Jun 11, 2019 at 7:46
  • Are you sure, you are calling right Scaffold? If you call Screen2 Scaffold, it won't work. You must call Screen1 Scaffold inside Screen2. Commented Jun 11, 2019 at 7:54
  • can you elaborate on that how to call screen1 scaffold inside screen2 ? currently am using scaffoldKey only on screen 1. Commented Jun 11, 2019 at 8:04
  • I explained it with a full demo. I hope it helps. @DK15 Commented Jun 11, 2019 at 8:24