1
- import 'package:device_preview /src/state/state.dart' ;
1
+ import 'package:ensemble_device_preview /src/state/state.dart' ;
2
2
import 'package:flutter/material.dart' ;
3
3
4
4
extension ThemeBackgroundExtension on DevicePreviewBackgroundThemeData {
@@ -36,30 +36,53 @@ extension ThemeToolbarExtension on DevicePreviewToolBarThemeData {
36
36
activeTickMarkColor: accentColor,
37
37
inactiveTickMarkColor: accentColor,
38
38
overlayColor: accentColor.withOpacity (0.12 ),
39
- ), checkboxTheme: CheckboxThemeData (
40
- fillColor: MaterialStateProperty .resolveWith <Color ?>((Set <MaterialState > states) {
41
- if (states.contains (MaterialState .disabled)) { return null ; }
42
- if (states.contains (MaterialState .selected)) { return accentColor; }
43
- return null ;
44
- }),
45
- ), radioTheme: RadioThemeData (
46
- fillColor: MaterialStateProperty .resolveWith <Color ?>((Set <MaterialState > states) {
47
- if (states.contains (MaterialState .disabled)) { return null ; }
48
- if (states.contains (MaterialState .selected)) { return accentColor; }
49
- return null ;
50
- }),
51
- ), switchTheme: SwitchThemeData (
52
- thumbColor: MaterialStateProperty .resolveWith <Color ?>((Set <MaterialState > states) {
53
- if (states.contains (MaterialState .disabled)) { return null ; }
54
- if (states.contains (MaterialState .selected)) { return accentColor; }
55
- return null ;
56
- }),
57
- trackColor: MaterialStateProperty .resolveWith <Color ?>((Set <MaterialState > states) {
58
- if (states.contains (MaterialState .disabled)) { return null ; }
59
- if (states.contains (MaterialState .selected)) { return accentColor; }
60
- return null ;
61
- }),
62
- ),
39
+ ),
40
+ checkboxTheme: CheckboxThemeData (
41
+ fillColor: MaterialStateProperty .resolveWith <Color ?>(
42
+ (Set <MaterialState > states) {
43
+ if (states.contains (MaterialState .disabled)) {
44
+ return null ;
45
+ }
46
+ if (states.contains (MaterialState .selected)) {
47
+ return accentColor;
48
+ }
49
+ return null ;
50
+ }),
51
+ ),
52
+ radioTheme: RadioThemeData (
53
+ fillColor: MaterialStateProperty .resolveWith <Color ?>(
54
+ (Set <MaterialState > states) {
55
+ if (states.contains (MaterialState .disabled)) {
56
+ return null ;
57
+ }
58
+ if (states.contains (MaterialState .selected)) {
59
+ return accentColor;
60
+ }
61
+ return null ;
62
+ }),
63
+ ),
64
+ switchTheme: SwitchThemeData (
65
+ thumbColor: MaterialStateProperty .resolveWith <Color ?>(
66
+ (Set <MaterialState > states) {
67
+ if (states.contains (MaterialState .disabled)) {
68
+ return null ;
69
+ }
70
+ if (states.contains (MaterialState .selected)) {
71
+ return accentColor;
72
+ }
73
+ return null ;
74
+ }),
75
+ trackColor: MaterialStateProperty .resolveWith <Color ?>(
76
+ (Set <MaterialState > states) {
77
+ if (states.contains (MaterialState .disabled)) {
78
+ return null ;
79
+ }
80
+ if (states.contains (MaterialState .selected)) {
81
+ return accentColor;
82
+ }
83
+ return null ;
84
+ }),
85
+ ),
63
86
);
64
87
case DevicePreviewToolBarThemeData .light:
65
88
final base = ThemeData .light ();
@@ -84,30 +107,53 @@ extension ThemeToolbarExtension on DevicePreviewToolBarThemeData {
84
107
activeTickMarkColor: accentColor,
85
108
inactiveTickMarkColor: accentColor,
86
109
overlayColor: accentColor.withOpacity (0.12 ),
87
- ), checkboxTheme: CheckboxThemeData (
88
- fillColor: MaterialStateProperty .resolveWith <Color ?>((Set <MaterialState > states) {
89
- if (states.contains (MaterialState .disabled)) { return null ; }
90
- if (states.contains (MaterialState .selected)) { return accentColor; }
91
- return null ;
92
- }),
93
- ), radioTheme: RadioThemeData (
94
- fillColor: MaterialStateProperty .resolveWith <Color ?>((Set <MaterialState > states) {
95
- if (states.contains (MaterialState .disabled)) { return null ; }
96
- if (states.contains (MaterialState .selected)) { return accentColor; }
97
- return null ;
98
- }),
99
- ), switchTheme: SwitchThemeData (
100
- thumbColor: MaterialStateProperty .resolveWith <Color ?>((Set <MaterialState > states) {
101
- if (states.contains (MaterialState .disabled)) { return null ; }
102
- if (states.contains (MaterialState .selected)) { return accentColor; }
103
- return null ;
104
- }),
105
- trackColor: MaterialStateProperty .resolveWith <Color ?>((Set <MaterialState > states) {
106
- if (states.contains (MaterialState .disabled)) { return null ; }
107
- if (states.contains (MaterialState .selected)) { return accentColor; }
108
- return null ;
109
- }),
110
- ),
110
+ ),
111
+ checkboxTheme: CheckboxThemeData (
112
+ fillColor: MaterialStateProperty .resolveWith <Color ?>(
113
+ (Set <MaterialState > states) {
114
+ if (states.contains (MaterialState .disabled)) {
115
+ return null ;
116
+ }
117
+ if (states.contains (MaterialState .selected)) {
118
+ return accentColor;
119
+ }
120
+ return null ;
121
+ }),
122
+ ),
123
+ radioTheme: RadioThemeData (
124
+ fillColor: MaterialStateProperty .resolveWith <Color ?>(
125
+ (Set <MaterialState > states) {
126
+ if (states.contains (MaterialState .disabled)) {
127
+ return null ;
128
+ }
129
+ if (states.contains (MaterialState .selected)) {
130
+ return accentColor;
131
+ }
132
+ return null ;
133
+ }),
134
+ ),
135
+ switchTheme: SwitchThemeData (
136
+ thumbColor: MaterialStateProperty .resolveWith <Color ?>(
137
+ (Set <MaterialState > states) {
138
+ if (states.contains (MaterialState .disabled)) {
139
+ return null ;
140
+ }
141
+ if (states.contains (MaterialState .selected)) {
142
+ return accentColor;
143
+ }
144
+ return null ;
145
+ }),
146
+ trackColor: MaterialStateProperty .resolveWith <Color ?>(
147
+ (Set <MaterialState > states) {
148
+ if (states.contains (MaterialState .disabled)) {
149
+ return null ;
150
+ }
151
+ if (states.contains (MaterialState .selected)) {
152
+ return accentColor;
153
+ }
154
+ return null ;
155
+ }),
156
+ ),
111
157
);
112
158
}
113
159
}
0 commit comments