Theme changes #4
@@ -8,15 +8,32 @@ 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(
|
||||||
|
height: 30,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
text,
|
text,
|
||||||
style: isError
|
style: isError
|
||||||
? TextStyle(color: Theme.of(context).colorScheme.onError)
|
? TextStyle(color: Theme.of(context).colorScheme.onError)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () =>
|
||||||
|
ScaffoldMessenger.of(context).hideCurrentSnackBar(),
|
||||||
|
icon: Icon(
|
||||||
|
Icons.close_rounded,
|
||||||
|
color: Theme.of(context).colorScheme.onError,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user