GridImagePicker constructor

GridImagePicker({
  1. Key? key,
  2. required dynamic defaultImages(),
  3. required String? setImageUrlFromItem(
    1. dynamic item
    ),
  4. ApiRequest? apiUploadImage,
  5. ApiRequest apiMainImage(
    1. dynamic item
    )?,
  6. ApiRequest apiDeleteImage(
    1. dynamic item
    )?,
  7. double height = 70,
  8. double width = 70,
  9. Widget? loading,
  10. int? imageQuality = 80,
  11. bool canDeleteImage = true,
  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
    )?,
})

Implementation

GridImagePicker(
    {super.key,
    required this.defaultImages,
    required this.setImageUrlFromItem,
    this.apiUploadImage,
    this.apiMainImage,
    this.apiDeleteImage,
    this.height = 70,
    this.width = 70,
    this.loading,
    this.imageQuality = 80,
    this.canDeleteImage = true,
    this.canSetMainImage = true,
    this.maxImages = 11,
    this.maxSize = 1024 * 1024 * 7, // 7MB
    this.allowedMimeTypes,
    this.setMainImageFromItem,
    this.onImageUploaded,
    this.onMainImageResponse,
    this.onDeleteImageResponse})
    : style = "default" {
  assert(maxImages > 0, "maxImages must be greater than 0");
  assert(maxSize > 0, "maxSize must be greater than 0");
}