File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ class Constants {
27
27
static AssetsPickerTextDelegate textDelegate =
28
28
DefaultAssetsPickerTextDelegate ();
29
29
static SortPathDelegate sortPathDelegate = SortPathDelegate .common;
30
+
31
+ static const List <int > defaultPreviewThumbSize = < int > [200 , 200 ];
30
32
}
31
33
32
34
/// Log only in debug mode.
Original file line number Diff line number Diff line change @@ -8,21 +8,22 @@ import 'dart:ui' as ui;
8
8
import 'package:flutter/material.dart' ;
9
9
import 'package:flutter/foundation.dart' ;
10
10
import 'package:photo_manager/photo_manager.dart' ;
11
+ import 'package:wechat_assets_picker/src/constants/constants.dart' ;
11
12
12
13
@immutable
13
14
class AssetEntityImageProvider extends ImageProvider <AssetEntityImageProvider > {
14
15
AssetEntityImageProvider (
15
16
this .entity, {
16
17
this .scale = 1.0 ,
17
- this .thumbSize = const < int > [ 200 , 200 ] ,
18
+ this .thumbSize = Constants .defaultPreviewThumbSize ,
18
19
this .isOriginal = true ,
19
20
}) : assert (
20
- thumbSize? .length == 2 ,
21
- 'thumbSize must contain and only contain two integers' ,
21
+ isOriginal || thumbSize? .length == 2 ,
22
+ 'thumbSize must contain and only contain two integers when it \' s not original ' ,
22
23
) {
23
- if (thumbSize? .length != 2 ) {
24
+ if (! isOriginal && thumbSize? .length != 2 ) {
24
25
throw ArgumentError (
25
- 'thumbSize must contain and only contain two integers' ,
26
+ 'thumbSize must contain and only contain two integers when it \' s not original ' ,
26
27
);
27
28
}
28
29
}
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ import 'dart:async';
6
6
7
7
import 'package:flutter/material.dart' ;
8
8
import 'package:video_player/video_player.dart' ;
9
+ import 'package:wechat_assets_picker/wechat_assets_picker.dart' ;
9
10
10
11
import 'package:wechat_assets_picker/src/constants/constants.dart' ;
11
- import 'package:wechat_assets_picker/wechat_assets_picker.dart' ;
12
12
13
13
class AudioPageBuilder extends StatefulWidget {
14
14
const AudioPageBuilder ({
You can’t perform that action at this time.
0 commit comments