[Feature request] Persisting snackbar
a7md0 opened this issue · 3 comments
a7md0 commented
I really liked the package (compared with showing Android styled snack bar)
I have a use case to show persisting messages until removed manually, something like "No internet connection" I want to keep the snack bar showing until the network state change.
What I tried:-
- I was able to change the
displayDuration
toconst Duration(days: 365)
which seems fine till now - I was not able to override the default dismiss on click, where I want the snack bar to not be dismissible (even with adding my own
onTap
it is still dismissible with user clicks) - I was not able to dismiss the widget programmatically after showing it (this may be related to #16)
Based on the use case above, I believe these features will most likely resolve it:-
- Add
bool isInfiniteDuration
which default to false; However, when set to true it disables the dismiss completely. - Add
bool isDismissible
which default to true; However, when set to true the user clicks won't dismiss the snack bar - (I'm not sure if this is the best approach) Return the
TopSnackBar
widget with theshowTopSnackBar
and expose a public method to dismiss the widget
a7md0 commented
I'm willing to create PR for those, if the suggested features are designed correctly
alexeypodolian commented
vizhan-lanars commented
@a7md0
Implemented in version 1.1.1