File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,7 @@ class AssetPickerProvider extends ChangeNotifier {
66
66
bool get isAssetsEmpty => _isAssetsEmpty;
67
67
68
68
set isAssetsEmpty (bool value) {
69
- assert (value != null );
70
- if (value == _isAssetsEmpty) {
69
+ if (value == null || value == _isAssetsEmpty) {
71
70
return ;
72
71
}
73
72
_isAssetsEmpty = value;
Original file line number Diff line number Diff line change @@ -80,14 +80,15 @@ class AssetPicker extends StatelessWidget {
80
80
Curve routeCurve = Curves .easeIn,
81
81
Duration routeDuration = const Duration (milliseconds: 300 ),
82
82
}) async {
83
- assert (
84
- pageSize % gridCount == 0 || pageSize == null ,
85
- 'pageSize must be a multiple of gridCount.' ,
86
- );
87
- assert (
88
- pickerTheme == null || themeColor == null ,
89
- 'Theme and theme color cannot be set at the same time.' ,
90
- );
83
+ if (maxAssets == null || maxAssets < 1 ) {
84
+ throw ArgumentError ('maxAssets must be greater than 1.' );
85
+ }
86
+ if (pageSize % gridCount == 0 || pageSize == null ) {
87
+ throw ArgumentError ('pageSize must be a multiple of gridCount.' );
88
+ }
89
+ if (pickerTheme == null || themeColor == null ) {
90
+ throw ArgumentError ('Theme and theme color cannot be set at the same time.' );
91
+ }
91
92
try {
92
93
final bool isPermissionGranted = await PhotoManager .requestPermission ();
93
94
if (isPermissionGranted) {
You can’t perform that action at this time.
0 commit comments