Skip to content

Commit 33d1ee8

Browse files
authored
⚡️ Improve total count calculation with path entity (#187)
1 parent 5eb11ad commit 33d1ee8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/delegates/asset_picker_builder_delegate.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import 'dart:math' as math;
77
import 'dart:typed_data';
88
import 'dart:ui' as ui;
99

10-
import 'package:flutter/material.dart';
1110
import 'package:flutter/gestures.dart';
11+
import 'package:flutter/material.dart';
1212
import 'package:flutter/scheduler.dart';
1313
import 'package:flutter/services.dart';
1414

@@ -808,9 +808,9 @@ class DefaultAssetPickerBuilderDelegate
808808
selector: (_, DefaultAssetPickerProvider p) => p.currentPathEntity,
809809
builder: (_, AssetPathEntity? path, __) {
810810
// First, we need the count of the assets.
811-
int totalCount = provider.currentPathEntity!.assetCount;
811+
int totalCount = path!.assetCount;
812812
// If user chose a special item's position, add 1 count.
813-
if (specialItemPosition != SpecialItemPosition.none) {
813+
if (specialItemPosition != SpecialItemPosition.none && path.isAll) {
814814
totalCount += 1;
815815
}
816816
// Then we use the [totalCount] to calculate how many placeholders we need.

0 commit comments

Comments
 (0)