InAppGalleryUtils class

Utility class for the in_app_gallery package. Provides methods to handle camera picking, media selection processing, and video/image compression.

Constructors

InAppGalleryUtils()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

progressStream → Stream<double>
Stream of compression progress (0.0 to 1.0)
no setter

Static Methods

compressImage(File file, {int quality = 50}) → Future<File>
Compresses an image and returns the compressed file.
compressVideo(File file) → Future<File>
Compresses a video using the native platform implementation via MethodChannel.
formatBytes(int bytes, [int decimals = 2]) → String
Formats byte size into human readable format (e.g. 1.5 MB).
onCameraPicked({required BuildContext context, int? imageQuality, bool isVideo = false}) → Future<File?>
Opens the device camera to take a photo or record a video. Checks for camera permissions first, and shows a settings permission dialog if permanently denied. Returns the picked File or null if the user cancelled or denied permission.
onSelectionCompleted({int? imageQuality, required List<AssetEntity> selectedMedia, required bool allowVideoCompression, void onVideoSizeExceeded(String filename)?, void onProgress(int current, int total)?}) → Future<List<File>>
Processes the selected media items from the gallery. Applies image and video compression if configured. Returns a list of processed Files ready for upload.