export method
export the runtime widget to json
Implementation
@override
Map<String, dynamic> export(Widget? widget, BuildContext? buildContext) {
var realWidget = widget as SelectableText;
if (realWidget.textSpan == null) {
return <String, dynamic>{
"type": "SelectableText",
"data": realWidget.data,
"textAlign": realWidget.textAlign != null
? exportTextAlign(realWidget.textAlign)
: "start",
"maxLines": realWidget.maxLines,
"textDirection": exportTextDirection(realWidget.textDirection),
"style": exportTextStyle(realWidget.style),
};
} else {
var parser = SelectableTextSpanParser();
return <String, dynamic>{
"type": "SelectableText",
"textSpan": parser.export(realWidget.textSpan!),
"textAlign": realWidget.textAlign != null
? exportTextAlign(realWidget.textAlign)
: "start",
"maxLines": realWidget.maxLines,
"textDirection": exportTextDirection(realWidget.textDirection),
"style": exportTextStyle(realWidget.style),
};
}
}