diff --git a/lib/service/notifying.dart b/lib/service/notifying.dart index 3d51154..bb8838a 100644 --- a/lib/service/notifying.dart +++ b/lib/service/notifying.dart @@ -8,14 +8,31 @@ class Notifying { required String text, bool isError = false, }) { + ScaffoldMessenger.of(context).hideCurrentSnackBar(); ScaffoldMessenger.of(context).showSnackBar( SnackBar( backgroundColor: Theme.of(context).colorScheme.error, - content: Text( - text, - style: isError - ? TextStyle(color: Theme.of(context).colorScheme.onError) - : null, + content: SizedBox( + height: 30, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + text, + style: isError + ? TextStyle(color: Theme.of(context).colorScheme.onError) + : null, + ), + IconButton( + onPressed: () => + ScaffoldMessenger.of(context).hideCurrentSnackBar(), + icon: Icon( + Icons.close_rounded, + color: Theme.of(context).colorScheme.onError, + ), + ), + ], + ), ), ), );