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. FilterOptionGroup? filterOptions,
  12. int gridCount = 4,
  13. Color? themeColor,
  14. ThemeData? pickerTheme,
  15. AssetPickerTextDelegate? textDelegate,
  16. SpecialItemPosition specialItemPosition = SpecialItemPosition.none,
  17. SpecialItemBuilder<AssetPathEntity>? specialItemBuilder,
  18. LoadingIndicatorBuilder? loadingIndicatorBuilder,
  19. AssetSelectPredicate<AssetEntity>? selectPredicate,
  20. bool? shouldRevertGrid,
  21. LimitedPermissionOverlayPredicate? limitedPermissionOverlayPredicate,
  22. 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.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(maxAssets >= 1, 'maxAssets must be greater than 1.'),
      assert(
        pickerTheme == null || themeColor == null,
        'pickerTheme and themeColor cannot be set at the same time.',
      ),
      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.',
      );