another-flushbar
another-flushbar copied to clipboard
Navigator.pop does not work
Common usage of classic snackbar is display snackbar and pop current page.
However when using Flushbar like this
ElevatedButton(
child: Text('Show Flushbar and pop!'),
onPressed: () {
Flushbar(
message: 'Pop!',
onStatusChanged: print,
duration: Duration(seconds: 4),
)..show(context);
Navigator.of(context).pop();
},
),
)
Nothing happens. No flushbar is displayed nor current page is popped.
When I try to listen for Flushbar's status changes, the states are
I/flutter (18959): FlushbarStatus.IS_APPEARING
I/flutter (18959): FlushbarStatus.DISMISSED
However when I remove Navigator.of(context).pop()
line. The printed status is:
I/flutter (18959): FlushbarStatus.IS_APPEARING
I/flutter (18959): FlushbarStatus.SHOWING
I/flutter (18959): FlushbarStatus.IS_HIDING
I/flutter (18959): FlushbarStatus.DISMISSED
I think this should be considered as a bug. With normal Flutter's snackbar this is not issue.
This confused me for quite a while until I finally realized what was happening.
I tried reversing the order of the statements (pop, then show flushbar), which seemed like it shouldn't work, but it did.
I also want Navigator.pop ignore option...
Is it possible for flushbar not react on Navigator.pop?
Is it possible for flushbar not react on Navigator.pop?
@cmdrootaccess @mkbsugita @robinbonnes
is there any way to achieve this?
I'd be glad if this worked somehow
It is impossible to use independent of navigation messages: on call pop it closes flushbar instead of pop the current page