Skip to content

Commit e967791

Browse files
committed
🐛 Fix notify issues in multi tab picker
Fix #372
1 parent 08e9cad commit e967791

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

example/lib/customs/pickers/multi_tabs_assets_picker.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -494,20 +494,20 @@ class MultiTabAssetPickerBuilder extends DefaultAssetPickerBuilderDelegate {
494494
Widget appleOSLayout(BuildContext context) => androidLayout(context);
495495

496496
Widget _buildGrid(BuildContext context) {
497-
return Selector<DefaultAssetPickerProvider, bool>(
498-
selector: (_, DefaultAssetPickerProvider p) => p.hasAssetsToDisplay,
499-
builder: (_, bool hasAssetsToDisplay, __) {
497+
return Consumer<DefaultAssetPickerProvider>(
498+
builder: (BuildContext context, DefaultAssetPickerProvider p, __) {
499+
final bool shouldDisplayAssets =
500+
p.hasAssetsToDisplay || shouldBuildSpecialItem;
500501
return AnimatedSwitcher(
501502
duration: const Duration(milliseconds: 300),
502-
child: hasAssetsToDisplay
503+
child: shouldDisplayAssets
503504
? Stack(
504505
children: <Widget>[
505506
RepaintBoundary(
506507
child: Column(
507508
children: <Widget>[
508509
Expanded(child: assetsGridBuilder(context)),
509-
if (isPreviewEnabled)
510-
bottomActionBar(context),
510+
if (isPreviewEnabled) bottomActionBar(context),
511511
],
512512
),
513513
),

0 commit comments

Comments
 (0)