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