getImageFromGallery method
Future<void> getImageFromGallery ({bool camera = false})
This function is used to get the image from gallery.
The function uses the _multiMediaPickerService
services.
params:
camera
: if true then open camera for image, else open gallery to select image.
returns:
Future<void>
: Getting image from gallery returns future
Implementation
Future<void> getImageFromGallery({bool camera = false}) async {
final image =
await _multiMediaPickerService.getPhotoFromGallery(camera: camera);
if (image != null) {
_imageFile = image;
_navigationService.showTalawaErrorSnackBar(
"Image is added",
MessageType.info,
);
notifyListeners();
}
}