call method

  1. @override
Object? call(
  1. Interpreter interpreter,
  2. List<Object?> arguments,
  3. Map<Symbol, Object?> namedArguments
)
override

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);
  });
}