Skip to content

Commit

Permalink
✨ exposes limitedPermissionOverlayPredicate param #35
Browse files Browse the repository at this point in the history
  • Loading branch information
LeGoffMael committed Dec 7, 2023
1 parent c473da9 commit c104666
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/insta_assets_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export 'package:wechat_assets_picker/wechat_assets_picker.dart'
AssetEntityImageProvider,
DefaultAssetPickerProvider,
SpecialItemPosition,
PhotoManager;
PhotoManager,
PermissionState;
export 'package:wechat_assets_picker/src/delegates/asset_picker_text_delegate.dart';
19 changes: 16 additions & 3 deletions lib/src/assets_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ class InstaAssetPicker {
/// - Set [loadingIndicatorBuilder] to specifies the loader indicator
/// to display in the picker.
///
/// - Set [limitedPermissionOverlayPredicate] to specifies if the limited
/// permission overlay should be displayed.
///
/// - Set [specialItemPosition] to allows users to set a special item in the picker
/// with several positions. Since the grid view is reversed, [SpecialItemPosition.prepend]
/// will be at the top and [SpecialItemPosition.append] at the bottom.
Expand Down Expand Up @@ -168,8 +171,11 @@ class InstaAssetPicker {
bool closeOnComplete = false,
required Function(Stream<InstaAssetsExportDetails> exportDetails)
onCompleted,
Widget Function(BuildContext, bool)? loadingIndicatorBuilder,
Widget? Function(BuildContext, AssetPathEntity?, int)? specialItemBuilder,
Widget Function(BuildContext context, bool isAssetsEmpty)?
loadingIndicatorBuilder,
LimitedPermissionOverlayPredicate? limitedPermissionOverlayPredicate,
Widget? Function(BuildContext context, AssetPathEntity? path, int length)?
specialItemBuilder,
SpecialItemPosition? specialItemPosition,
InstaPickerActionsBuilder? actionsBuilder,
}) async {
Expand Down Expand Up @@ -197,6 +203,7 @@ class InstaAssetPicker {
keepScrollOffset: true,
textDelegate: text,
loadingIndicatorBuilder: loadingIndicatorBuilder,
limitedPermissionOverlayPredicate: limitedPermissionOverlayPredicate,
closeOnComplete: closeOnComplete,
cropDelegate: cropDelegate,
onCompleted: onCompleted,
Expand Down Expand Up @@ -249,6 +256,9 @@ class InstaAssetPicker {
/// - Set [loadingIndicatorBuilder] to specifies the loader indicator
/// to display in the picker.
///
/// - Set [limitedPermissionOverlayPredicate] to specifies if the limited
/// permission overlay should be displayed.
///
/// - Set [actionsBuilder] function to specifies the [Widget]s to display
/// on top of the assets grid view. Default is unselect all assets button.
///
Expand Down Expand Up @@ -303,7 +313,9 @@ class InstaAssetPicker {
bool closeOnComplete = false,
required Function(Stream<InstaAssetsExportDetails> exportDetails)
onCompleted,
Widget Function(BuildContext, bool)? loadingIndicatorBuilder,
Widget Function(BuildContext context, bool isAssetsEmpty)?
loadingIndicatorBuilder,
LimitedPermissionOverlayPredicate? limitedPermissionOverlayPredicate,

/// DefaultAssetPickerProvider options
List<AssetEntity>? selectedAssets,
Expand Down Expand Up @@ -352,6 +364,7 @@ class InstaAssetPicker {
keepScrollOffset: false,
textDelegate: text,
loadingIndicatorBuilder: loadingIndicatorBuilder,
limitedPermissionOverlayPredicate: limitedPermissionOverlayPredicate,
closeOnComplete: closeOnComplete,
cropDelegate: cropDelegate,
onCompleted: onCompleted,
Expand Down
1 change: 1 addition & 0 deletions lib/src/widget/insta_asset_picker_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class InstaAssetPickerBuilder extends DefaultAssetPickerBuilderDelegate {
super.locale,
super.keepScrollOffset,
super.loadingIndicatorBuilder,
super.limitedPermissionOverlayPredicate,
super.specialItemBuilder,
SpecialItemPosition? specialItemPosition,
this.title,
Expand Down

0 comments on commit c104666

Please sign in to comment.