call method
Implementation
@override
Object? call(Interpreter interpreter, List<Object?> arguments,
Map<Symbol, Object?> namedArguments) {
var imageParsed = namedArguments[const Symbol('image')];
if (imageParsed == null) {
throw "image required in Image";
}
ImageProvider image = imageParsed as ImageProvider;
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.low;
var filterQualityParse = namedArguments[const Symbol('filterQuality')];
if (filterQualityParse != null) {
filterQuality = filterQualityParse as FilterQuality;
}
return Image(
image: image,
height: height,
width: width,
repeat: repeat,
matchTextDirection: matchTextDirection,
filterQuality: filterQuality,
isAntiAlias: isAntiAlias,
alignment: alignment,
colorBlendMode: blendMode,
color: color,
fit: fit,
);
}