Error messages
This commit is contained in:
15
lib/services/scaffold_messenger.dart
Normal file
15
lib/services/scaffold_messenger.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Messenger {
|
||||
static void showError(BuildContext context, String error) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
backgroundColor: Theme.of(context).colorScheme.error,
|
||||
content: Text(
|
||||
error,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.onError),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user