We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cd11de commit 4ab635bCopy full SHA for 4ab635b
‎lib/main.dart‎
@@ -1,6 +1,6 @@
1
import 'package:flutter/material.dart';
2
+import 'package:theme_provider/util/theme_notifier.dart';
3
import 'screens/home.dart';
-
4
void main() {
5
runApp(MyApp());
6
}
‎lib/util/theme_notifier.dart‎
@@ -0,0 +1,14 @@
+import 'package:flutter/material.dart';
+
+class ThemeNotifier with ChangeNotifier {
+ ThemeData _themeData;
+ ThemeNotifier(this._themeData);
7
8
+ getTheme() => _themeData;
9
10
+ setTheme(ThemeData themeData) async {
11
+ _themeData = themeData;
12
+ notifyListeners();
13
+ }
14
+}
0 commit comments