Skip to content

Commit 36a130f

Browse files
committed
PickMethod.pathNameBuilder
1 parent 0e7c01e commit 36a130f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

example/lib/constants/picker_method.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,24 @@ class PickMethod {
379379
);
380380
}
381381

382+
factory PickMethod.pathNameBuilder(int maxAssetsCount) {
383+
return PickMethod(
384+
icon: '#️⃣',
385+
name: 'Path name builder',
386+
description: 'Add 🍭 after paths name.',
387+
method: (BuildContext context, List<AssetEntity> assets) {
388+
return AssetPicker.pickAssets(
389+
context,
390+
pickerConfig: AssetPickerConfig(
391+
maxAssets: maxAssetsCount,
392+
selectedAssets: assets,
393+
pathNameBuilder: (AssetPathEntity path) => '${path.name}🍭',
394+
),
395+
);
396+
},
397+
);
398+
}
399+
382400
final String icon;
383401
final String name;
384402
final String description;

0 commit comments

Comments
 (0)