GridImagePicker constructor

GridImagePicker({
  1. Key? key,
  2. required dynamic defaultImages(),
  3. required String? setImageUrlFromItem(
    1. dynamic item
    ),
  4. ApiRequest? apiUpload,
  5. ApiRequest apiMainImage(
    1. dynamic item
    )?,
  6. ApiRequest apiDeleteImage(
    1. dynamic item
    )?,
  7. double height = 400,
  8. double width = 70,
  9. Widget? loading,
  10. int? imageQuality = 80,
  11. bool canDeleteImage(
    1. dynamic item
    )?,
  12. bool canSetMainImage = true,
  13. int maxImages = 11,
  14. double maxSize = 1024 * 1024 * 7,
  15. List<String>? allowedMimeTypes,
  16. bool? setMainImageFromItem(
    1. dynamic item
    )?,
  17. dynamic onImageUploaded(
    1. dynamic response
    )?,
  18. dynamic onMainImageResponse(
    1. dynamic response
    )?,
  19. dynamic onDeleteImageResponse(
    1. dynamic response
    )?,
  20. String itemIdResolver(
    1. dynamic item
    )?,
  21. UploadMode uploadMode = UploadMode.standard,
  22. ImageCompressionOptions? compressionOptions,
  23. bool displayValidationHint = true,
  24. Widget placeholder = const SizedBox.shrink(),
  25. void onDragCompletion(
    1. List<String> newOrder
    )?,
  26. void onImageLongPress(
    1. dynamic item
    )?,
  27. Future onUploadImages(
    1. List<XFile> images
    )?,
  28. Widget newItemAnimationBuilder(
    1. BuildContext,
    2. Widget child
    )?,
  29. Widget loadingPlaceholderBuilder(
    1. BuildContext
    )?,
  30. Widget pendingTileBuilder(
    1. BuildContext,
    2. File file,
    3. double? progress
    )?,
  31. Widget dragPlaceholderBuilder(
    1. BuildContext
    )?,
  32. Widget dragFeedbackBuilder(
    1. BuildContext context,
    2. Widget child
    )?,
  33. String deleteConfirmationTitle = "Delete image?",
})

Implementation

GridImagePicker(
    {super.key,
    required this.defaultImages,
    required this.setImageUrlFromItem,
    this.apiUpload,
    this.apiMainImage,
    this.apiDeleteImage,
    this.height = 400,
    this.width = 70,
    this.loading,
    this.imageQuality = 80,
    this.canDeleteImage,
    this.canSetMainImage = true,
    this.maxImages = 11,
    this.maxSize = 1024 * 1024 * 7, // 7MB
    this.allowedMimeTypes,
    this.setMainImageFromItem,
    this.onImageUploaded,
    this.onMainImageResponse,
    this.onDeleteImageResponse,
    this.itemIdResolver,
    this.uploadMode = UploadMode.standard,
    this.compressionOptions,
    this.displayValidationHint = true,
    this.placeholder = const SizedBox.shrink(),
    this.onDragCompletion,
    this.onImageLongPress,
    this.onUploadImages,
    this.newItemAnimationBuilder,
    this.loadingPlaceholderBuilder,
    this.pendingTileBuilder,
    this.dragPlaceholderBuilder,
    this.dragFeedbackBuilder,
    this.deleteConfirmationTitle = "Delete image?"}) {
  assert(maxImages > 0, "maxImages must be greater than 0");
  assert(maxSize > 0, "maxSize must be greater than 0");
}