@@ -6,7 +6,8 @@ import 'dart:async';
6
6
7
7
import 'package:camera/camera.dart' ;
8
8
import 'package:flutter/material.dart' ;
9
- import 'package:flutter/services.dart' ;
9
+ import 'package:wechat_picker_library/wechat_picker_library.dart'
10
+ show buildTheme;
10
11
11
12
import '../constants/config.dart' ;
12
13
import '../internals/singleton.dart' ;
@@ -64,48 +65,11 @@ class CameraPicker extends StatefulWidget {
64
65
65
66
/// Build a dark theme according to the theme color.
66
67
/// 通过主题色构建一个默认的暗黑主题
67
- static ThemeData themeData (Color themeColor) {
68
- return ThemeData .dark ().copyWith (
69
- primaryColor: Colors .grey[900 ],
70
- primaryColorLight: Colors .grey[900 ],
71
- primaryColorDark: Colors .grey[900 ],
72
- canvasColor: Colors .grey[850 ],
73
- scaffoldBackgroundColor: Colors .grey[900 ],
74
- cardColor: Colors .grey[900 ],
75
- highlightColor: Colors .transparent,
76
- textSelectionTheme: TextSelectionThemeData (
77
- cursorColor: themeColor,
78
- selectionColor: themeColor.withAlpha (100 ),
79
- selectionHandleColor: themeColor,
80
- ),
81
- // ignore: deprecated_member_use
82
- indicatorColor: themeColor,
83
- appBarTheme: const AppBarTheme (
84
- systemOverlayStyle: SystemUiOverlayStyle (
85
- statusBarBrightness: Brightness .dark,
86
- statusBarIconBrightness: Brightness .light,
87
- ),
88
- elevation: 0 ,
89
- ),
90
- buttonTheme: ButtonThemeData (buttonColor: themeColor),
91
- colorScheme: ColorScheme (
92
- primary: Colors .grey[900 ]! ,
93
- primaryContainer: Colors .grey[900 ],
94
- secondary: themeColor,
95
- secondaryContainer: themeColor,
96
- // ignore: deprecated_member_use
97
- background: Colors .grey[900 ]! ,
98
- surface: Colors .grey[900 ]! ,
99
- brightness: Brightness .dark,
100
- error: const Color (0xffcf6679 ),
101
- onPrimary: Colors .black,
102
- onSecondary: Colors .black,
103
- onSurface: Colors .white,
104
- // ignore: deprecated_member_use
105
- onBackground: Colors .white,
106
- onError: Colors .black,
107
- ),
108
- );
68
+ static ThemeData themeData (
69
+ Color themeColor, {
70
+ bool light = false ,
71
+ }) {
72
+ return buildTheme (themeColor, light: light);
109
73
}
110
74
111
75
@override
0 commit comments