AssetPickerConfig constructor

const AssetPickerConfig({
  1. List<AssetEntity>? selectedAssets,
  2. int maxAssets = defaultMaxAssetsCount,
  3. int pageSize = defaultAssetsPerPage,
  4. ThumbnailSize gridThumbnailSize = defaultAssetGridPreviewSize,
  5. ThumbnailSize pathThumbnailSize = defaultPathThumbnailSize,
  6. ThumbnailSize? previewThumbnailSize,
  7. RequestType requestType = RequestType.common,
  8. SpecialPickerType? specialPickerType,
  9. bool keepScrollOffset = false,
  10. SortPathDelegate<AssetPathEntity>? sortPathDelegate,
  11. bool sortPathsByModifiedDate = false,
  12. PMFilter? filterOptions,
  13. int gridCount = 4,
  14. Color? themeColor,
  15. ThemeData? pickerTheme,
  16. AssetPickerTextDelegate? textDelegate,
  17. SpecialItemPosition specialItemPosition = SpecialItemPosition.none,
  18. SpecialItemBuilder<AssetPathEntity>? specialItemBuilder,
  19. LoadingIndicatorBuilder? loadingIndicatorBuilder,
  20. AssetSelectPredicate<AssetEntity>? selectPredicate,
  21. bool? shouldRevertGrid,
  22. LimitedPermissionOverlayPredicate? limitedPermissionOverlayPredicate,
  23. PathNameBuilder<AssetPathEntity>? pathNameBuilder,
})

Implementation

const AssetPickerConfig({
  this.selectedAssets,
  this.maxAssets = defaultMaxAssetsCount,
  this.pageSize = defaultAssetsPerPage,
  this.gridThumbnailSize = defaultAssetGridPreviewSize,
  this.pathThumbnailSize = defaultPathThumbnailSize,
  this.previewThumbnailSize,
  this.requestType = RequestType.common,
  this.specialPickerType,
  this.keepScrollOffset = false,
  this.sortPathDelegate,
  this.sortPathsByModifiedDate = false,
  this.filterOptions,
  this.gridCount = 4,
  this.themeColor,
  this.pickerTheme,
  this.textDelegate,
  this.specialItemPosition = SpecialItemPosition.none,
  this.specialItemBuilder,
  this.loadingIndicatorBuilder,
  this.selectPredicate,
  this.shouldRevertGrid,
  this.limitedPermissionOverlayPredicate,
  this.pathNameBuilder,
})  : assert(
        pickerTheme == null || themeColor == null,
        'pickerTheme and themeColor cannot be set at the same time.',
      ),
      assert(maxAssets > 0, 'maxAssets must be greater than 0.'),
      assert(pageSize > 0, 'pageSize must be greater than 0.'),
      assert(gridCount > 0, 'gridCount must be greater than 0.'),
      assert(
        pageSize % gridCount == 0,
        'pageSize must be a multiple of gridCount.',
      ),
      assert(
        specialPickerType != SpecialPickerType.wechatMoment ||
            requestType == RequestType.common,
        'SpecialPickerType.wechatMoment and requestType '
        'cannot be set at the same time.',
      ),
      assert(
        (specialItemBuilder == null &&
                identical(specialItemPosition, SpecialItemPosition.none)) ||
            (specialItemBuilder != null &&
                !identical(specialItemPosition, SpecialItemPosition.none)),
        'Custom item did not set properly.',
      );