Files
oott/frontend/lib/utils/ui_snackbars.dart
T
rzuastiandClaude Sonnet 4.6 a647e0d061 Add theme selection to settings page
Adds a dropdown in the settings page to switch between available themes
(Catppuccin Mocha, Gruvbox Dark). The selected theme is applied immediately
on save and persisted across restarts via SharedPreferences.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 11:38:16 -04:00

34 lines
960 B
Dart

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