pickImage method

Future<void> pickImage({
  1. int? maxSize,
})

Open the image dialog picker

Implementation

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