@@ -20,7 +20,7 @@ import '../constants/colors.dart';
20
20
import '../constants/constants.dart' ;
21
21
import '../constants/enums.dart' ;
22
22
import '../constants/extensions.dart' ;
23
- import '../delegates/assets_picker_text_delegate .dart' ;
23
+ import '../delegates/asset_picker_text_delegate .dart' ;
24
24
import '../provider/asset_picker_provider.dart' ;
25
25
import '../widget/asset_picker.dart' ;
26
26
import '../widget/asset_picker_viewer.dart' ;
@@ -57,8 +57,6 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
57
57
required this .provider,
58
58
required this .initialPermission,
59
59
this .gridCount = 4 ,
60
- Color ? themeColor,
61
- AssetsPickerTextDelegate ? textDelegate,
62
60
this .pickerTheme,
63
61
this .specialItemPosition = SpecialItemPosition .none,
64
62
this .specialItemBuilder,
@@ -67,13 +65,17 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
67
65
this .keepScrollOffset = false ,
68
66
this .selectPredicate,
69
67
this .shouldRevertGrid,
68
+ Color ? themeColor,
69
+ AssetPickerTextDelegate ? textDelegate,
70
+ Locale ? locale,
70
71
}) : assert (
71
72
pickerTheme == null || themeColor == null ,
72
73
'Theme and theme color cannot be set at the same time.' ,
73
74
),
74
75
themeColor =
75
76
pickerTheme? .colorScheme.secondary ?? themeColor ?? C .themeColor {
76
- Constants .textDelegate = textDelegate ?? AssetsPickerTextDelegate ();
77
+ Constants .textDelegate =
78
+ textDelegate ?? assetPickerTextDelegateFromLocale (locale);
77
79
// Add the listener if [keepScrollOffset] is true.
78
80
if (keepScrollOffset) {
79
81
gridScrollController.addListener (keepScrollOffsetListener);
@@ -212,7 +214,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
212
214
213
215
bool get effectiveShouldRevertGrid => shouldRevertGrid ?? isAppleOS;
214
216
215
- AssetsPickerTextDelegate get textDelegate => Constants .textDelegate;
217
+ AssetPickerTextDelegate get textDelegate => Constants .textDelegate;
216
218
217
219
/// The listener to track the scroll position of the [gridScrollController]
218
220
/// if [keepScrollOffset] is true.
@@ -685,8 +687,6 @@ class DefaultAssetPickerBuilderDelegate
685
687
required DefaultAssetPickerProvider provider,
686
688
required PermissionState initialPermission,
687
689
int gridCount = 4 ,
688
- Color ? themeColor,
689
- AssetsPickerTextDelegate ? textDelegate,
690
690
ThemeData ? pickerTheme,
691
691
SpecialItemPosition specialItemPosition = SpecialItemPosition .none,
692
692
WidgetBuilder ? specialItemBuilder,
@@ -698,6 +698,9 @@ class DefaultAssetPickerBuilderDelegate
698
698
this .gridThumbSize = Constants .defaultGridThumbSize,
699
699
this .previewThumbSize,
700
700
this .specialPickerType,
701
+ Color ? themeColor,
702
+ AssetPickerTextDelegate ? textDelegate,
703
+ Locale ? locale,
701
704
}) : assert (
702
705
pickerTheme == null || themeColor == null ,
703
706
'Theme and theme color cannot be set at the same time.' ,
@@ -706,8 +709,6 @@ class DefaultAssetPickerBuilderDelegate
706
709
provider: provider,
707
710
initialPermission: initialPermission,
708
711
gridCount: gridCount,
709
- themeColor: themeColor,
710
- textDelegate: textDelegate,
711
712
pickerTheme: pickerTheme,
712
713
specialItemPosition: specialItemPosition,
713
714
specialItemBuilder: specialItemBuilder,
@@ -716,6 +717,9 @@ class DefaultAssetPickerBuilderDelegate
716
717
keepScrollOffset: keepScrollOffset,
717
718
selectPredicate: selectPredicate,
718
719
shouldRevertGrid: shouldRevertGrid,
720
+ themeColor: themeColor,
721
+ textDelegate: textDelegate,
722
+ locale: locale,
719
723
);
720
724
721
725
/// Thumbnail size in the grid.
0 commit comments