another-flushbar icon indicating copy to clipboard operation
another-flushbar copied to clipboard

Navigator.pop does not work

Open petrnymsa opened this issue 3 years ago • 6 comments

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.

petrnymsa avatar Nov 04 '21 13:11 petrnymsa

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.

anamba avatar Dec 18 '21 08:12 anamba

I also want Navigator.pop ignore option...

mkbsugita avatar Apr 05 '23 01:04 mkbsugita

Is it possible for flushbar not react on Navigator.pop?

adminant avatar Apr 23 '23 14:04 adminant

Is it possible for flushbar not react on Navigator.pop?

@cmdrootaccess @mkbsugita @robinbonnes

is there any way to achieve this?

waqadArshad avatar Jun 29 '23 00:06 waqadArshad

I'd be glad if this worked somehow

Linaks avatar Aug 03 '23 21:08 Linaks

It is impossible to use independent of navigation messages: on call pop it closes flushbar instead of pop the current page

akucherk avatar Oct 09 '23 06:10 akucherk