2023-06-14 00:26:04 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2023-06-17 03:09:31 +02:00
|
|
|
class ThemeManager with ChangeNotifier {
|
2023-06-14 00:26:04 +02:00
|
|
|
ThemeMode _themeMode = ThemeMode.light;
|
|
|
|
|
2023-06-17 03:09:31 +02:00
|
|
|
ThemeMode get themeMode => _themeMode;
|
2023-06-14 00:26:04 +02:00
|
|
|
|
2023-06-17 03:09:31 +02:00
|
|
|
void toggleTheme(bool isDark) {
|
|
|
|
_themeMode = isDark ? ThemeMode.dark : ThemeMode.light;
|
2023-06-14 00:26:04 +02:00
|
|
|
notifyListeners();
|
|
|
|
|
2023-06-17 03:09:31 +02:00
|
|
|
}
|
2023-06-14 00:26:04 +02:00
|
|
|
}
|