Skip to content

Commit acac0f6

Browse files
committed
💥 Breaking text delegate with new duration indicator builder.
1 parent 55e5f33 commit acac0f6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/src/constants/text_delegate.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ abstract class TextDelegate {
5050
/// 未支持的资源类型的字段
5151
String unSupportedAssetType;
5252

53-
/// This is used in video asset item in picker, in order to display the duration of the asset.
54-
/// 该字段用在选择器视频部件上,用于显示视频资源的时长。
55-
String videoIndicatorBuilder(Duration duration);
53+
/// This is used in video asset item in picker, in order to display
54+
/// the duration of the video or audio type of asset.
55+
/// 该字段用在选择器视频或音频部件上,用于显示视频或音频资源的时长。
56+
String durationIndicatorBuilder(Duration duration);
5657
}
5758

5859
/// Default text delegate implements with Chinese.
@@ -98,7 +99,7 @@ class DefaultTextDelegate implements TextDelegate {
9899
String unSupportedAssetType = '尚未支持的资源类型';
99100

100101
@override
101-
String videoIndicatorBuilder(Duration duration) {
102+
String durationIndicatorBuilder(Duration duration) {
102103
const String separator = ':';
103104
final String minute = '${(duration.inMinutes).toString().padLeft(2, '0')}';
104105
final String second =

lib/src/widget/asset_picker.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ class AssetPicker extends StatelessWidget {
536536
Padding(
537537
padding: const EdgeInsets.only(left: 4.0),
538538
child: Text(
539-
Constants.textDelegate
540-
.videoIndicatorBuilder(Duration(seconds: asset.duration)),
539+
Constants.textDelegate.durationIndicatorBuilder(
540+
Duration(seconds: asset.duration)),
541541
style: const TextStyle(fontSize: 16.0),
542542
),
543543
),

0 commit comments

Comments
 (0)