call method
Implementation
@override
Object? call(Interpreter interpreter, List<Object?> arguments,
Map<Symbol, Object?> namedArguments) {
double? maxWidth = parseDouble(namedArguments[const Symbol('maxWidth')]);
double? maxHeight = parseDouble(namedArguments[const Symbol('maxHeight')]);
var source = namedArguments[const Symbol('source')];
if (source == null) {
throw "source required in ImagePicker";
}
return picker
.getImage(
source: source as ImageSource,
maxHeight: maxHeight,
maxWidth: maxWidth)
.then((value) {
if (value == null) return value;
return ImagePickerXfile(value);
});
}