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 scale = parseDouble(namedArguments[const Symbol('scale')]) ?? 1.0;

  double? height = parseDouble(namedArguments[const Symbol('height')]);
  double? width = parseDouble(namedArguments[const Symbol('width')]);
  BoxFit? fit;
  var fitParsed = namedArguments[const Symbol('fit')];
  if (fitParsed != null) {
    fit = fitParsed as BoxFit;
  }
  Color? color;
  var colorParse = namedArguments[const Symbol('color')];
  if (colorParse != null) {
    color = colorParse as Color;
  }
  AlignmentGeometry alignment = Alignment.center;
  var alignmentParse = namedArguments[const Symbol('alignment')];
  if (alignmentParse != null) {
    alignment = alignmentParse as AlignmentGeometry;
  }
  BlendMode? blendMode;
  var blendModeParse = namedArguments[const Symbol('blendMode')];
  if (blendModeParse != null) {
    blendMode = blendModeParse as BlendMode;
  }
  ImageRepeat repeat = ImageRepeat.noRepeat;
  var repeatParse = namedArguments[const Symbol('repeat')];
  if (repeatParse != null) {
    repeat = repeatParse as ImageRepeat;
  }
  bool matchTextDirection = false;
  var matchTextDirectionParse =
      namedArguments[const Symbol('matchTextDirection')];
  if (matchTextDirectionParse != null) {
    matchTextDirection = matchTextDirectionParse as bool;
  }
  bool isAntiAlias = false;
  var isAntiAliasParse = namedArguments[const Symbol('isAntiAlias')];
  if (isAntiAliasParse != null) {
    isAntiAlias = isAntiAliasParse as bool;
  }
  FilterQuality filterQuality = FilterQuality.medium;
  var filterQualityParse = namedArguments[const Symbol('filterQuality')];
  if (filterQualityParse != null) {
    filterQuality = filterQualityParse as FilterQuality;
  }
  return Image.file(arguments[0] as File,
      scale: scale,
      width: width,
      height: height,
      fit: fit,
      alignment: alignment,
      repeat: repeat,
      matchTextDirection: matchTextDirection,
      isAntiAlias: isAntiAlias,
      color: color,
      colorBlendMode: blendMode,
      filterQuality: filterQuality);
}