How to show snackbar after navigator.pop(context) in Flutter?

Emily Harkness picture Emily Harkness · Jul 10, 2018 · Viewed 8.3k times · Source

We need close one screen and open second screen. And show snackbar on second screen from first screen.

I tried to use Navigator.push , but this screen is already open and we have this error "Bad state: Stream has already been listened to".

Answer

Aman Malhotra picture Aman Malhotra · Jul 10, 2018

Instead of Snackbar i would suggest you to use Flushbar plugin for flutter it is easy to use and it'll take care of everything and u can customize it to a great extent . Snackbar needs a scaffold ancestor to work but Flushbar doesn't and it takes care of all the extra stuff itself and provides with ton of cool features.

Flushbar Plugin here