@@ -2,20 +2,19 @@ import 'package:flutter/material.dart';
2
2
import 'package:hacktoberfest_flutter/main.dart' ;
3
3
import 'package:hacktoberfest_flutter/shared/colors.dart' ;
4
4
5
- class ThemeProvider extends ChangeNotifier {
6
-
7
- var lightTheme= ThemeData (
5
+ class ThemeProvider extends ChangeNotifier {
6
+ var lightTheme = ThemeData (
8
7
fontFamily: 'Poppins-Regular' ,
9
8
focusColor: hacktoberVioletLight,
10
9
indicatorColor: hacktoberViolet,
11
- highlightColor: Color (0xFFAA96DA ),
12
- iconButtonTheme : IconButtonThemeData (
10
+ highlightColor: const Color (0xFFAA96DA ),
11
+ iconButtonTheme: IconButtonThemeData (
13
12
style: ButtonStyle (
14
13
iconColor: MaterialStateProperty .all (Colors .black),
15
14
),
16
15
),
17
16
appBarTheme: const AppBarTheme (
18
- backgroundColor: Colors .white,
17
+ backgroundColor: Colors .white,
19
18
),
20
19
secondaryHeaderColor: Colors .black,
21
20
primaryColor: Colors .white,
@@ -26,56 +25,60 @@ class ThemeProvider extends ChangeNotifier{
26
25
labelColor: hacktoberViolet,
27
26
indicatorColor: hacktoberViolet,
28
27
labelStyle: const TextStyle (
29
- fontWeight: FontWeight .w600,fontSize: 16 ,
28
+ fontWeight: FontWeight .w600,
29
+ fontSize: 16 ,
30
30
),
31
31
unselectedLabelStyle: const TextStyle (
32
- fontWeight: FontWeight .w600,fontSize: 16 ,
32
+ fontWeight: FontWeight .w600,
33
+ fontSize: 16 ,
33
34
),
34
35
unselectedLabelColor: Colors .black,
35
36
),
36
37
inputDecorationTheme: InputDecorationTheme (
37
38
suffixIconColor: Colors .black,
38
- labelStyle: const TextStyle (
39
- fontSize: 15 ,
40
- color: Colors .black,
41
- ),
42
- helperStyle: const TextStyle (
43
- color: Colors .black,
44
- ),
39
+ labelStyle: const TextStyle (
40
+ fontSize: 15 ,
41
+ color: Colors .black,
42
+ ),
43
+ helperStyle: const TextStyle (
44
+ color: Colors .black,
45
+ ),
45
46
enabledBorder: OutlineInputBorder (
46
47
borderSide: BorderSide (
47
- color: hacktoberViolet,),
48
+ color: hacktoberViolet,
49
+ ),
48
50
borderRadius: const BorderRadius .all (Radius .circular (20 )),
49
51
),
50
52
focusedBorder: OutlineInputBorder (
51
53
borderSide: BorderSide (
52
- color: hacktoberViolet,),
53
- borderRadius: const BorderRadius .all (Radius .circular (20 )),
54
+ color: hacktoberViolet,
55
+ ),
56
+ borderRadius: const BorderRadius .all (Radius .circular (20 )),
54
57
),
55
58
),
56
59
listTileTheme: const ListTileThemeData (
57
- textColor: Colors .black,
60
+ textColor: Colors .black,
58
61
),
59
62
dialogTheme: const DialogTheme (
60
- titleTextStyle: TextStyle (
61
- color: Colors .black,
62
- fontWeight: FontWeight .w600,
63
- fontSize: 20 ,
64
- ),
65
- backgroundColor: Colors .white,
63
+ titleTextStyle: TextStyle (
64
+ color: Colors .black,
65
+ fontWeight: FontWeight .w600,
66
+ fontSize: 20 ,
66
67
),
68
+ backgroundColor: Colors .white,
69
+ ),
67
70
);
68
71
69
72
//global darkTheme for app
70
73
var darkTheme = ThemeData (
71
74
fontFamily: 'Poppins-Regular' ,
72
75
focusColor: darkModeCardLight,
73
76
indicatorColor: darkModeCard,
74
- highlightColor: Color (0xFF206993 ),
75
- iconButtonTheme : IconButtonThemeData (
76
- style: ButtonStyle (
77
- iconColor: MaterialStateProperty .all (const Color (0xff93C2DB )),
78
- ),
77
+ highlightColor: const Color (0xFF206993 ),
78
+ iconButtonTheme: IconButtonThemeData (
79
+ style: ButtonStyle (
80
+ iconColor: MaterialStateProperty .all (const Color (0xff93C2DB )),
81
+ ),
79
82
),
80
83
appBarTheme: const AppBarTheme (
81
84
backgroundColor: Color (0xff3C3C3C ),
@@ -88,10 +91,12 @@ class ThemeProvider extends ChangeNotifier{
88
91
labelColor: darkModeCard,
89
92
indicatorColor: darkModeCard,
90
93
labelStyle: const TextStyle (
91
- fontWeight: FontWeight .w600,fontSize: 16 ,
94
+ fontWeight: FontWeight .w600,
95
+ fontSize: 16 ,
92
96
),
93
97
unselectedLabelStyle: const TextStyle (
94
- fontWeight: FontWeight .w600,fontSize: 16 ,
98
+ fontWeight: FontWeight .w600,
99
+ fontSize: 16 ,
95
100
),
96
101
unselectedLabelColor: Colors .white,
97
102
),
@@ -104,15 +109,17 @@ class ThemeProvider extends ChangeNotifier{
104
109
helperStyle: const TextStyle (
105
110
color: Colors .white,
106
111
),
107
- enabledBorder: OutlineInputBorder (
112
+ enabledBorder: OutlineInputBorder (
108
113
borderSide: BorderSide (
109
- color: darkModeCard,),
110
- borderRadius: const BorderRadius .all (Radius .circular (20 )),
114
+ color: darkModeCard,
115
+ ),
116
+ borderRadius: const BorderRadius .all (Radius .circular (20 )),
111
117
),
112
118
focusedBorder: OutlineInputBorder (
113
119
borderSide: BorderSide (
114
- color: darkModeCard,),
115
- borderRadius: const BorderRadius .all (Radius .circular (20 )),
120
+ color: darkModeCard,
121
+ ),
122
+ borderRadius: const BorderRadius .all (Radius .circular (20 )),
116
123
),
117
124
),
118
125
listTileTheme: const ListTileThemeData (
@@ -129,9 +136,8 @@ class ThemeProvider extends ChangeNotifier{
129
136
);
130
137
131
138
//changeTheme to set the theme chosen in settings page
132
- void changeTheme (bool isOn){
133
- device.theme= isOn? 'Dark' : 'Light' ;
139
+ void changeTheme (bool isOn) {
140
+ device.theme = isOn ? 'Dark' : 'Light' ;
134
141
notifyListeners ();
135
142
}
136
-
137
143
}
0 commit comments