pickImage method

Future<void> pickImage()

Open the image dialog picker

Implementation

Future<void> pickImage() async => await FilePicker.platform.pickFiles(
  type              : FileType.custom,
  allowedExtensions : _fileTypes,
  lockParentWindow  : true,
  allowMultiple     : false,
  withData          : true
).then((response) async {
  if (response == null) {
    _reset(error: true);
  } else {
    _file       = response.files.single;
    _bytes      = _file?.bytes;
    _extension  = _file?.extension??'';
    _hasImage   = true;
  }
  notifyListeners();
});