Added dismiss button
Some checks failed
Flutter APK Build / Build Flutter APK (pull_request) Has been cancelled

This commit is contained in:
2026-01-21 16:37:03 +01:00
parent d0492b2f79
commit 3032e13dc9

View File

@@ -8,14 +8,31 @@ class Notifying {
required String text, required String text,
bool isError = false, bool isError = false,
}) { }) {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
backgroundColor: Theme.of(context).colorScheme.error, backgroundColor: Theme.of(context).colorScheme.error,
content: Text( content: SizedBox(
text, height: 30,
style: isError child: Row(
? TextStyle(color: Theme.of(context).colorScheme.onError) mainAxisAlignment: MainAxisAlignment.spaceBetween,
: null, 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,
),
),
],
),
), ),
), ),
); );