stacked icon indicating copy to clipboard operation
stacked copied to clipboard

[bug]: Closing dialog would close the SnackBar instead

Open dvagala opened this issue 8 months ago • 3 comments

Describe the bug

Currently, when you open a dialog, then snackbar, and you call the completer(DialogResponse()); inside the dialog, it would actually close the snackbar.

I suppose it's because it shares the same navigation inside the Get package.

What operating system do you use?

macOS

Information about the installed tooling

No response

Steps to reproduce the issue

  1. registerCustomDialogBuilders ...
  2. snackbarService.registerCustomSnackbarConfig ...
  3. showCustomDialog ...
  4. showCustomSnackBar ...
  5. completer(DialogResponse()) in dialog

Expected behavior

It should close the dialog. Not the snackbar

Screenshots

No response

Additional Context

No response

dvagala avatar Aug 14 '25 15:08 dvagala

A workaround seems to be to call Navigator.of(context).pop(DialogResponse()); instead

dvagala avatar Aug 14 '25 16:08 dvagala

Thanks for sharing the workout @dvagala that's an interesting situation, never came accross it before.

It'll be the same for bottom sheets as well I think.

FilledStacks avatar Aug 19 '25 13:08 FilledStacks

Yeah, it seems all the navigation is shared. Even when you want to close the screen with the _navigationService.back();, it would close the snackbar if it's visible.

I'll describe my use case:

Show a Loading dialog when some processing is happening, but when this processing fails, show an error snackbar, and simultaneously close the Loading dialog.

dvagala avatar Aug 19 '25 15:08 dvagala