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

34 lines
960 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
2026-05-27 11:38:16 -04:00
import '../theme/app_colors.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) {
2026-05-27 11:38:16 -04:00
final appColors = Theme.of(context).extension<AppColorExtension>()!;
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
message,
2026-05-27 11:38:16 -04:00
style: TextStyle(color: appColors.onSuccess),
),
behavior: SnackBarBehavior.floating,
showCloseIcon: true,
2026-05-27 11:38:16 -04:00
backgroundColor: appColors.success,
),
);
}
}