Skip to content

Commit 77e5287

Browse files
committed
♻️ Refactored theme getter and static method.
1 parent 0323ba0 commit 77e5287

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/src/widget/asset_picker.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class AssetPicker extends StatelessWidget {
136136

137137
/// [ThemeData] for picker.
138138
/// 选择器使用的主题
139-
ThemeData get theme => ThemeData.dark().copyWith(
139+
static ThemeData themeData(Color themeColor) => ThemeData.dark().copyWith(
140140
buttonColor: themeColor,
141141
brightness: Brightness.dark,
142142
primaryColor: Colors.grey[900],
@@ -161,6 +161,8 @@ class AssetPicker extends StatelessWidget {
161161
),
162162
);
163163

164+
ThemeData get theme => themeData(themeColor);
165+
164166
/// Path entity select widget.
165167
/// 路径选择部件
166168
Widget get pathEntitySelector => UnconstrainedBox(

0 commit comments

Comments
 (0)