mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
32 lines
872 B
Dart
32 lines
872 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class UISnackbars {
|
|
static void showError(BuildContext context, String message) {
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
SnackBar(
|
|
content: Text(
|
|
message,
|
|
style: TextStyle(color: Theme.of(context).colorScheme.onError),
|
|
),
|
|
behavior: SnackBarBehavior.floating,
|
|
showCloseIcon: true,
|
|
backgroundColor: Theme.of(context).colorScheme.error,
|
|
),
|
|
);
|
|
}
|
|
|
|
static void showSuccess(BuildContext context, String message) {
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
SnackBar(
|
|
content: Text(
|
|
message,
|
|
style: TextStyle(color: Theme.of(context).colorScheme.onPrimary),
|
|
),
|
|
behavior: SnackBarBehavior.floating,
|
|
showCloseIcon: true,
|
|
backgroundColor: Colors.lightGreen,
|
|
),
|
|
);
|
|
}
|
|
}
|