@@ -41,7 +41,7 @@ class CameraPicker extends StatefulWidget {
41
41
this .maximumRecordingDuration = const Duration (seconds: 15 ),
42
42
this .theme,
43
43
this .resolutionPreset = ResolutionPreset .max,
44
- this .imageFormatGroup = ImageFormatGroup .jpeg ,
44
+ this .imageFormatGroup = ImageFormatGroup .unknown ,
45
45
this .cameraQuarterTurns = 0 ,
46
46
this .foregroundBuilder,
47
47
this .onEntitySaving,
@@ -114,9 +114,6 @@ class CameraPicker extends StatefulWidget {
114
114
115
115
/// The [ImageFormatGroup] describes the output of the raw image format.
116
116
/// 输出图像的格式描述
117
- ///
118
- /// When null the imageFormat will fallback to the platforms default.
119
- /// 为空时将使用平台默认值
120
117
final ImageFormatGroup imageFormatGroup;
121
118
122
119
/// The foreground widget builder which will cover the whole camera preview.
@@ -143,7 +140,7 @@ class CameraPicker extends StatefulWidget {
143
140
int cameraQuarterTurns = 0 ,
144
141
CameraPickerTextDelegate ? textDelegate,
145
142
ResolutionPreset resolutionPreset = ResolutionPreset .max,
146
- ImageFormatGroup imageFormatGroup = ImageFormatGroup .jpeg ,
143
+ ImageFormatGroup imageFormatGroup = ImageFormatGroup .unknown ,
147
144
Widget Function (CameraValue )? foregroundBuilder,
148
145
EntitySaveCallback ? onEntitySaving,
149
146
}) async {
@@ -182,47 +179,45 @@ class CameraPicker extends StatefulWidget {
182
179
183
180
/// Build a dark theme according to the theme color.
184
181
/// 通过主题色构建一个默认的暗黑主题
185
- static ThemeData themeData (Color themeColor) => ThemeData .dark ().copyWith (
186
- buttonColor: themeColor,
182
+ static ThemeData themeData (Color themeColor) {
183
+ return ThemeData .dark ().copyWith (
184
+ buttonColor: themeColor,
185
+ primaryColor: Colors .grey[900 ],
186
+ primaryColorBrightness: Brightness .dark,
187
+ primaryColorLight: Colors .grey[900 ],
188
+ primaryColorDark: Colors .grey[900 ],
189
+ accentColor: themeColor,
190
+ accentColorBrightness: Brightness .dark,
191
+ canvasColor: Colors .grey[850 ],
192
+ scaffoldBackgroundColor: Colors .grey[900 ],
193
+ bottomAppBarColor: Colors .grey[900 ],
194
+ cardColor: Colors .grey[900 ],
195
+ highlightColor: Colors .transparent,
196
+ toggleableActiveColor: themeColor,
197
+ textSelectionTheme: TextSelectionThemeData (
198
+ cursorColor: themeColor,
199
+ selectionColor: themeColor.withAlpha (100 ),
200
+ selectionHandleColor: themeColor,
201
+ ),
202
+ indicatorColor: themeColor,
203
+ appBarTheme: const AppBarTheme (brightness: Brightness .dark, elevation: 0 ),
204
+ colorScheme: ColorScheme (
205
+ primary: Colors .grey[900 ]! ,
206
+ primaryVariant: Colors .grey[900 ]! ,
207
+ secondary: themeColor,
208
+ secondaryVariant: themeColor,
209
+ background: Colors .grey[900 ]! ,
210
+ surface: Colors .grey[900 ]! ,
187
211
brightness: Brightness .dark,
188
- primaryColor: Colors .grey[900 ],
189
- primaryColorBrightness: Brightness .dark,
190
- primaryColorLight: Colors .grey[900 ],
191
- primaryColorDark: Colors .grey[900 ],
192
- accentColor: themeColor,
193
- accentColorBrightness: Brightness .dark,
194
- canvasColor: Colors .grey[850 ],
195
- scaffoldBackgroundColor: Colors .grey[900 ],
196
- bottomAppBarColor: Colors .grey[900 ],
197
- cardColor: Colors .grey[900 ],
198
- highlightColor: Colors .transparent,
199
- toggleableActiveColor: themeColor,
200
- textSelectionTheme: TextSelectionThemeData (
201
- cursorColor: themeColor,
202
- selectionColor: themeColor.withAlpha (100 ),
203
- selectionHandleColor: themeColor,
204
- ),
205
- indicatorColor: themeColor,
206
- appBarTheme: const AppBarTheme (
207
- brightness: Brightness .dark,
208
- elevation: 0 ,
209
- ),
210
- colorScheme: ColorScheme (
211
- primary: Colors .grey[900 ]! ,
212
- primaryVariant: Colors .grey[900 ]! ,
213
- secondary: themeColor,
214
- secondaryVariant: themeColor,
215
- background: Colors .grey[900 ]! ,
216
- surface: Colors .grey[900 ]! ,
217
- brightness: Brightness .dark,
218
- error: const Color (0xffcf6679 ),
219
- onPrimary: Colors .black,
220
- onSecondary: Colors .black,
221
- onSurface: Colors .white,
222
- onBackground: Colors .white,
223
- onError: Colors .black,
224
- ),
225
- );
212
+ error: const Color (0xffcf6679 ),
213
+ onPrimary: Colors .black,
214
+ onSecondary: Colors .black,
215
+ onSurface: Colors .white,
216
+ onBackground: Colors .white,
217
+ onError: Colors .black,
218
+ ),
219
+ );
220
+ }
226
221
227
222
@override
228
223
CameraPickerState createState () => CameraPickerState ();
0 commit comments