@@ -50,6 +50,16 @@ abstract class AssetsPickerTextDelegate {
50
50
/// to display the duration of the video or audio type of asset.
51
51
/// 该字段用在选择器视频或音频部件上,用于显示视频或音频资源的时长。
52
52
String durationIndicatorBuilder (Duration duration);
53
+
54
+ static String defaultDurationIndicatorBuilder (Duration duration) {
55
+ const String separator = ':' ;
56
+ final String minute = duration.inMinutes.toString ().padLeft (2 , '0' );
57
+ final String second =
58
+ ((duration - Duration (minutes: duration.inMinutes)).inSeconds)
59
+ .toString ()
60
+ .padLeft (2 , '0' );
61
+ return '$minute $separator $second ' ;
62
+ }
53
63
}
54
64
55
65
/// Default text delegate implements with Chinese.
@@ -93,15 +103,8 @@ class DefaultAssetsPickerTextDelegate implements AssetsPickerTextDelegate {
93
103
String unSupportedAssetType = '尚未支持的资源类型' ;
94
104
95
105
@override
96
- String durationIndicatorBuilder (Duration duration) {
97
- const String separator = ':' ;
98
- final String minute = duration.inMinutes.toString ().padLeft (2 , '0' );
99
- final String second =
100
- ((duration - Duration (minutes: duration.inMinutes)).inSeconds)
101
- .toString ()
102
- .padLeft (2 , '0' );
103
- return '$minute $separator $second ' ;
104
- }
106
+ String durationIndicatorBuilder (Duration duration) =>
107
+ AssetsPickerTextDelegate .defaultDurationIndicatorBuilder (duration);
105
108
}
106
109
107
110
/// [AssetsPickerTextDelegate] implements with English.
@@ -144,13 +147,50 @@ class EnglishTextDelegate implements AssetsPickerTextDelegate {
144
147
String unSupportedAssetType = 'Unsupported HEIC asset type.' ;
145
148
146
149
@override
147
- String durationIndicatorBuilder (Duration duration) {
148
- const String separator = ':' ;
149
- final String minute = duration.inMinutes.toString ().padLeft (2 , '0' );
150
- final String second =
151
- ((duration - Duration (minutes: duration.inMinutes)).inSeconds)
152
- .toString ()
153
- .padLeft (2 , '0' );
154
- return '$minute $separator $second ' ;
155
- }
150
+ String durationIndicatorBuilder (Duration duration) =>
151
+ AssetsPickerTextDelegate .defaultDurationIndicatorBuilder (duration);
152
+ }
153
+
154
+ /// [AssetsPickerTextDelegate] implements with Hebrew.
155
+ /// 希伯来文字实现
156
+ class HebrewTextDelegate implements AssetsPickerTextDelegate {
157
+ factory HebrewTextDelegate () => _instance;
158
+
159
+ HebrewTextDelegate ._internal ();
160
+
161
+ static final HebrewTextDelegate _instance = HebrewTextDelegate ._internal ();
162
+
163
+ @override
164
+ String confirm = 'אישור' ;
165
+
166
+ @override
167
+ String cancel = 'ביטול' ;
168
+
169
+ @override
170
+ String edit = 'עריכה' ;
171
+
172
+ @override
173
+ String gifIndicator = 'GIF' ;
174
+
175
+ @override
176
+ String heicNotSupported = 'קובץ HEIC לא נתמך.' ;
177
+
178
+ @override
179
+ String loadFailed = 'הטעינה נכשלה' ;
180
+
181
+ @override
182
+ String original = 'מקור' ;
183
+
184
+ @override
185
+ String preview = 'תצוגה מקדימה' ;
186
+
187
+ @override
188
+ String select = 'בחר' ;
189
+
190
+ @override
191
+ String unSupportedAssetType = 'סוג קובץ HEIC אינו נתמך' ;
192
+
193
+ @override
194
+ String durationIndicatorBuilder (Duration duration) =>
195
+ AssetsPickerTextDelegate .defaultDurationIndicatorBuilder (duration);
156
196
}
0 commit comments