export method
export the runtime widget to json
Implementation
@override
Map<String, dynamic> export(Widget? widget, BuildContext? buildContext) {
var realWidget = widget as Image;
late NetworkImage networkImage;
if (realWidget.image is NetworkImage) {
networkImage = realWidget.image as NetworkImage;
} else if (realWidget.image is ResizeImage) {
var t = realWidget.image as ResizeImage;
networkImage = t.imageProvider as NetworkImage;
}
return <String, dynamic>{
"type": widgetName,
"src": networkImage.url,
"semanticLabel": realWidget.semanticLabel,
"excludeFromSemantics": realWidget.excludeFromSemantics,
"width": realWidget.width,
"height": realWidget.height,
"color": realWidget.color != null
? realWidget.color!.value.toRadixString(16)
: null,
"colorBlendMode": realWidget.colorBlendMode != null
? exportBlendMode(realWidget.colorBlendMode)
: null,
"fit": realWidget.fit != null ? exportBoxFit(realWidget.fit) : null,
"alignment": realWidget.alignment != null
? exportAlignment(realWidget.alignment as Alignment?)
: null,
"repeat": realWidget.repeat != null
? exportImageRepeat(realWidget.repeat)
: null,
"centerSlice": realWidget.centerSlice != null
? exportRect(realWidget.centerSlice!)
: null,
"matchTextDirection": realWidget.matchTextDirection,
"gaplessPlayback": realWidget.gaplessPlayback,
"filterQuality": realWidget.filterQuality != null
? exportFilterQuality(realWidget.filterQuality)
: null
};
}