@@ -6,10 +6,10 @@ import 'dart:async';
6
6
import 'dart:io' ;
7
7
import 'dart:math' as math;
8
8
9
+ import 'package:camera/camera.dart' ;
9
10
import 'package:flutter/material.dart' ;
10
11
import 'package:flutter/scheduler.dart' ;
11
12
import 'package:flutter/services.dart' ;
12
- import 'package:camera/camera.dart' ;
13
13
14
14
import '../constants/constants.dart' ;
15
15
import '../widget/circular_progress_bar.dart' ;
@@ -176,13 +176,10 @@ class CameraPicker extends StatefulWidget {
176
176
/// 通过主题色构建一个默认的暗黑主题
177
177
static ThemeData themeData (Color themeColor) {
178
178
return ThemeData .dark ().copyWith (
179
- buttonColor: themeColor,
180
179
primaryColor: Colors .grey[900 ],
181
180
primaryColorBrightness: Brightness .dark,
182
181
primaryColorLight: Colors .grey[900 ],
183
182
primaryColorDark: Colors .grey[900 ],
184
- accentColor: themeColor,
185
- accentColorBrightness: Brightness .dark,
186
183
canvasColor: Colors .grey[850 ],
187
184
scaffoldBackgroundColor: Colors .grey[900 ],
188
185
bottomAppBarColor: Colors .grey[900 ],
@@ -195,7 +192,14 @@ class CameraPicker extends StatefulWidget {
195
192
selectionHandleColor: themeColor,
196
193
),
197
194
indicatorColor: themeColor,
198
- appBarTheme: const AppBarTheme (brightness: Brightness .dark, elevation: 0 ),
195
+ appBarTheme: const AppBarTheme (
196
+ systemOverlayStyle: SystemUiOverlayStyle (
197
+ statusBarBrightness: Brightness .dark,
198
+ statusBarIconBrightness: Brightness .light,
199
+ ),
200
+ elevation: 0 ,
201
+ ),
202
+ buttonTheme: ButtonThemeData (buttonColor: themeColor),
199
203
colorScheme: ColorScheme (
200
204
primary: Colors .grey[900 ]! ,
201
205
primaryVariant: Colors .grey[900 ]! ,
@@ -369,6 +373,7 @@ class CameraPickerState extends State<CameraPicker>
369
373
/// Hide system status bar automatically when the platform is not Android.
370
374
/// 在非 Android 设备上自动隐藏状态栏
371
375
if (! Platform .isAndroid) {
376
+ // ignore: deprecated_member_use
372
377
SystemChrome .setEnabledSystemUIOverlays (< SystemUiOverlay > []);
373
378
}
374
379
@@ -382,6 +387,7 @@ class CameraPickerState extends State<CameraPicker>
382
387
@override
383
388
void dispose () {
384
389
if (! Platform .isAndroid) {
390
+ // ignore: deprecated_member_use
385
391
SystemChrome .setEnabledSystemUIOverlays (SystemUiOverlay .values);
386
392
}
387
393
WidgetsBinding .instance? .removeObserver (this );
0 commit comments