openPicker method
Future<List<HLPickerItem> >
openPicker({
- List<
String> ? selectedIds, - HLPickerOptions? pickerOptions,
- bool? cropping,
- HLCropOptions? cropOptions,
- LocalizedImagePicker? localized,
Select images or videos from a library
selectedIds
: A list of string IDs representing the initially selected images or videos from the library. This allows users to pre-select items before opening the picker.
pickerOptions
: Additional options for the picker: mediaType
, maxSelectedAssets
, maxFileSize
,...
cropping
: Indicating whether or not cropping is enabled. Just work when mediaType = MediaType.image
cropOptions
: Configuration options for the cropping functionality: aspectRatio
, aspectRatioPresets
, compressQuality
, compressFormat
localized
: Custom text displayed for the plugin
Returns a list of HLPickerItem
Implementation
Future<List<HLPickerItem>> openPicker({
List<String>? selectedIds,
HLPickerOptions? pickerOptions,
bool? cropping,
HLCropOptions? cropOptions,
LocalizedImagePicker? localized,
}) async {
return platform.openPicker(
selectedIds: selectedIds,
cropping: cropping,
pickerOptions: pickerOptions,
cropOptions: cropOptions,
localized: localized,
);
}