2024-12-22 05:07:22 +00:00
|
|
|
import 'dart:ui';
|
|
|
|
|
2024-11-08 16:09:46 +00:00
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:surface/theme.dart';
|
|
|
|
|
|
|
|
class ThemeProvider extends ChangeNotifier {
|
2024-11-10 13:48:42 +00:00
|
|
|
ThemeSet? theme;
|
2024-11-08 16:09:46 +00:00
|
|
|
|
|
|
|
ThemeProvider() {
|
2024-11-10 13:48:42 +00:00
|
|
|
createAppThemeSet().then((value) {
|
|
|
|
theme = value;
|
|
|
|
notifyListeners();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-12-22 05:07:22 +00:00
|
|
|
void reloadTheme({Color? seedColorOverride, bool? useMaterial3}) {
|
|
|
|
createAppThemeSet(seedColorOverride: seedColorOverride, useMaterial3: useMaterial3).then((value) {
|
2024-11-10 13:48:42 +00:00
|
|
|
theme = value;
|
|
|
|
notifyListeners();
|
|
|
|
});
|
2024-11-08 16:09:46 +00:00
|
|
|
}
|
|
|
|
}
|