Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigator.pop does not work #52

Open
petrnymsa opened this issue Nov 4, 2021 · 6 comments
Open

Navigator.pop does not work #52

petrnymsa opened this issue Nov 4, 2021 · 6 comments

Comments

@petrnymsa
Copy link

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.

@anamba
Copy link

anamba commented Dec 18, 2021

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.

@mkbsugita
Copy link

I also want Navigator.pop ignore option...

@adminant
Copy link

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

@waqadArshad
Copy link

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

@cmdrootaccess @mkbsugita @robinbonnes

is there any way to achieve this?

@Linaks
Copy link

Linaks commented Aug 3, 2023

I'd be glad if this worked somehow

@akucherk
Copy link

akucherk commented Oct 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants