Files
oott/frontend/lib/utils/ui_snackbars.dart
T

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,
),
);
}
}