Skip to content

Commit

Permalink
fix: poping previous scaffold messages
Browse files Browse the repository at this point in the history
  • Loading branch information
IamMuuo committed Dec 17, 2024
1 parent 2be151e commit 10e2fc9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/features/home/views/layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class _LayoutState extends State<Layout> {
// Received changes in available connectivity types!
if (result.contains(ConnectivityResult.none)) {
if (!mounted) return;
ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
duration: Duration(days: 30),
Expand All @@ -53,6 +54,8 @@ class _LayoutState extends State<Layout> {
}
if (!result.contains(ConnectivityResult.none)) {
if (!mounted) return;

ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
showCloseIcon: true,
Expand Down

0 comments on commit 10e2fc9

Please sign in to comment.