@@ -405,39 +405,39 @@ class DefaultAssetPickerViewerBuilderDelegate
405
405
return ValueListenableBuilder2 <bool , int >(
406
406
firstNotifier: isDisplayingDetail,
407
407
secondNotifier: selectedNotifier,
408
- builder: (_, bool value, int count, Widget ? child) =>
409
- AnimatedPositionedDirectional (
408
+ builder: (_, bool v, __, Widget ? child) => AnimatedPositionedDirectional (
410
409
duration: kThemeAnimationDuration,
411
410
curve: Curves .easeInOut,
412
- bottom: value ? 0. 0 : - (Screens .bottomSafeHeight + bottomDetailHeight),
413
- start: 0.0 ,
414
- end: 0.0 ,
411
+ bottom: v ? 0 : - (Screens .bottomSafeHeight + bottomDetailHeight),
412
+ start: 0 ,
413
+ end: 0 ,
415
414
height: Screens .bottomSafeHeight + bottomDetailHeight,
416
415
child: child! ,
417
416
),
418
- child: Container (
417
+ child: Padding (
419
418
padding: EdgeInsetsDirectional .only (bottom: Screens .bottomSafeHeight),
420
419
child: ChangeNotifierProvider <
421
- AssetPickerViewerProvider <AssetEntity >>.value (
422
- value: provider! ,
420
+ AssetPickerViewerProvider <AssetEntity >? >.value (
421
+ value: provider,
423
422
child: Column (
424
423
mainAxisSize: MainAxisSize .min,
425
424
mainAxisAlignment: MainAxisAlignment .end,
426
425
children: < Widget > [
427
- ValueListenableBuilder <int >(
428
- valueListenable: selectedNotifier,
429
- builder: (_, int count, __) => Container (
430
- width: count > 0 ? double .maxFinite : 0 ,
431
- height: 90 ,
432
- color: _backgroundColor,
433
- child: ListView .builder (
434
- scrollDirection: Axis .horizontal,
435
- padding: const EdgeInsets .symmetric (horizontal: 5.0 ),
436
- itemCount: count,
437
- itemBuilder: bottomDetailItemBuilder,
426
+ if (provider != null )
427
+ ValueListenableBuilder <int >(
428
+ valueListenable: selectedNotifier,
429
+ builder: (_, int count, __) => Container (
430
+ width: count > 0 ? double .maxFinite : 0 ,
431
+ height: 90 ,
432
+ color: _backgroundColor,
433
+ child: ListView .builder (
434
+ scrollDirection: Axis .horizontal,
435
+ padding: const EdgeInsets .symmetric (horizontal: 5.0 ),
436
+ itemCount: count,
437
+ itemBuilder: bottomDetailItemBuilder,
438
+ ),
438
439
),
439
440
),
440
- ),
441
441
Container (
442
442
height: 50 ,
443
443
padding: const EdgeInsets .symmetric (horizontal: 20.0 ),
@@ -454,7 +454,7 @@ class DefaultAssetPickerViewerBuilderDelegate
454
454
mainAxisAlignment: MainAxisAlignment .spaceBetween,
455
455
children: < Widget > [
456
456
const Spacer (),
457
- if (isAppleOS && provider != null )
457
+ if (isAppleOS && ( provider != null || isWeChatMoment) )
458
458
confirmButton (context)
459
459
else
460
460
selectButton (context),
@@ -498,18 +498,18 @@ class DefaultAssetPickerViewerBuilderDelegate
498
498
pageController.jumpToPage (index);
499
499
}
500
500
},
501
- child: Selector <AssetPickerViewerProvider <AssetEntity >,
502
- List <AssetEntity >>(
503
- selector: (_, AssetPickerViewerProvider <AssetEntity > p) =>
504
- p.currentlySelectedAssets,
501
+ child: Selector <AssetPickerViewerProvider <AssetEntity >? ,
502
+ List <AssetEntity >? >(
503
+ selector: (_, AssetPickerViewerProvider <AssetEntity >? p) =>
504
+ p? .currentlySelectedAssets,
505
505
child: _item,
506
506
builder: (
507
507
_,
508
- List <AssetEntity > currentlySelectedAssets,
508
+ List <AssetEntity >? currentlySelectedAssets,
509
509
Widget ? w,
510
510
) {
511
511
final bool isSelected =
512
- currentlySelectedAssets.contains (asset);
512
+ currentlySelectedAssets? .contains (asset) ?? false ;
513
513
return Stack (
514
514
children: < Widget > [
515
515
w! ,
@@ -578,7 +578,7 @@ class DefaultAssetPickerViewerBuilderDelegate
578
578
),
579
579
const Spacer (),
580
580
if (isAppleOS && provider != null ) selectButton (context),
581
- if (! isAppleOS && provider != null || isWeChatMoment)
581
+ if (! isAppleOS && ( provider != null || isWeChatMoment) )
582
582
confirmButton (context),
583
583
],
584
584
),
0 commit comments