@@ -2,23 +2,25 @@ import 'package:flutter/material.dart';
2
2
3
3
appThemeData () {
4
4
return ThemeData (
5
- primarySwatch: forestGreenColor,
6
- backgroundColor: mistColor,
7
- colorScheme: ColorScheme .fromSwatch (primarySwatch: forestGreenColor),
8
- errorColor: darkRedColor)
5
+ colorScheme: ColorScheme .fromSwatch (primarySwatch: forestGreenColor, backgroundColor: mistColor, errorColor: darkRedColor))
9
6
.copyWith (
10
7
textButtonTheme: TextButtonThemeData (
11
8
style: TextButton .styleFrom (
12
- foregroundColor: Colors .blue ,
9
+ foregroundColor: Colors .white ,
13
10
),
14
11
),
12
+ switchTheme: SwitchThemeData (
13
+ trackColor: MaterialStateProperty .all <Color >(forestGreenColor),
14
+ thumbColor: MaterialStateProperty .all <Color >(Colors .white),
15
+ ),
15
16
checkboxTheme: CheckboxThemeData (
16
17
checkColor: MaterialStateProperty .all (Colors .white),
17
18
fillColor: MaterialStateProperty .all (forestGreenColor),
18
19
),
19
20
elevatedButtonTheme: ElevatedButtonThemeData (
20
21
style: ButtonStyle (
21
- foregroundColor: MaterialStateProperty .all <Color >(Colors .white),
22
+ backgroundColor: MaterialStateProperty .all <Color >(forestGreenColor),
23
+ overlayColor: MaterialStateProperty .all <Color >(Colors .lightGreen),
22
24
textStyle: MaterialStateProperty .all <TextStyle >(
23
25
const TextStyle (color: Colors .white)),
24
26
),
@@ -29,7 +31,7 @@ appThemeData() {
29
31
headerFooterBoxDecoration (BuildContext context, bool isHeader) {
30
32
final theme = Theme .of (context);
31
33
return BoxDecoration (
32
- color: theme.backgroundColor ,
34
+ color: theme.colorScheme.background ,
33
35
border: Border (
34
36
top: isHeader
35
37
? BorderSide .none
@@ -44,22 +46,22 @@ errorBoxDecoration(BuildContext context) {
44
46
final theme = Theme .of (context);
45
47
return BoxDecoration (
46
48
border: Border .all (color: Colors .black),
47
- color: theme.backgroundColor ,
49
+ color: theme.colorScheme.background ,
48
50
borderRadius: const BorderRadius .all (Radius .circular (8 )));
49
51
}
50
52
51
53
infoBoxDecoration (BuildContext context) {
52
54
final theme = Theme .of (context);
53
55
return BoxDecoration (
54
56
border: Border .all (color: Colors .black),
55
- color: theme.backgroundColor ,
57
+ color: theme.colorScheme.background ,
56
58
borderRadius: const BorderRadius .all (Radius .circular (8 )));
57
59
}
58
60
59
61
errorTextStyle (BuildContext context, {bool bold = false }) {
60
62
final theme = Theme .of (context);
61
63
return TextStyle (
62
- color: theme.errorColor ,
64
+ color: theme.colorScheme.error ,
63
65
fontWeight: bold ? FontWeight .bold : FontWeight .normal);
64
66
}
65
67
@@ -105,5 +107,5 @@ MaterialColor mistColor = MaterialColor(
105
107
},
106
108
);
107
109
108
- Color get darkRedColor => Color .fromARGB (255 , 208 , 18 , 5 );
110
+ Color get darkRedColor => const Color .fromARGB (255 , 208 , 18 , 5 );
109
111
Color get lightRedColor => const Color .fromARGB (255 , 244 , 223 , 221 );
0 commit comments