feat: modo dia/noche y campana de notificaciones
- ThemeProvider con persistencia en SharedPreferences - Toggle animado en sidebar (sol/luna con switch visual) - Temas light y dark completos en MaterialApp - Campana en navbar con badge rojo y panel inferior de notificaciones Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
76c05a5820
commit
842a67cdea
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:prosapp_web_app/services/local_storage.dart';
|
||||
|
||||
class ThemeProvider extends ChangeNotifier {
|
||||
static const _key = 'dark_mode';
|
||||
|
||||
ThemeMode _mode = ThemeMode.light;
|
||||
ThemeMode get mode => _mode;
|
||||
bool get isDark => _mode == ThemeMode.dark;
|
||||
|
||||
ThemeProvider() {
|
||||
final saved = LocalStorage.prefs.getBool(_key) ?? false;
|
||||
_mode = saved ? ThemeMode.dark : ThemeMode.light;
|
||||
}
|
||||
|
||||
void toggle() {
|
||||
_mode = isDark ? ThemeMode.light : ThemeMode.dark;
|
||||
LocalStorage.prefs.setBool(_key, isDark);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user