mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
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>
34 lines
960 B
Dart
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,
|
|
),
|
|
);
|
|
}
|
|
}
|