export method
export the runtime widget to json
Implementation
@override
Map<String, dynamic> export(Widget? widget, BuildContext? buildContext) {
var realWidget = widget as GridViewWidget;
String scrollDirection = "vertical";
if (realWidget._params.scrollDirection == Axis.horizontal) {
scrollDirection = "horizontal";
}
var padding = realWidget._params.padding as EdgeInsets?;
return <String, dynamic>{
"type": "GridView",
"scrollDirection": scrollDirection,
"crossAxisCount": realWidget._params.crossAxisCount,
"reverse": realWidget._params.reverse ?? false,
"shrinkWrap": realWidget._params.shrinkWrap ?? false,
"cacheExtent": realWidget._params.cacheExtent ?? 0.0,
"padding": padding != null
? "${padding.left},${padding.top},${padding.right},${padding.bottom}"
: null,
"mainAxisSpacing": realWidget._params.mainAxisSpacing ?? 0.0,
"crossAxisSpacing": realWidget._params.crossAxisSpacing ?? 0.0,
"childAspectRatio": realWidget._params.childAspectRatio ?? 1.0,
"pageSize": realWidget._params.pageSize ?? 10,
"loadMoreUrl": realWidget._params.loadMoreUrl ?? null,
"isDemo": realWidget._params.isDemo ?? false,
"children": DynamicWidgetBuilder.exportWidgets(
realWidget._params.children!, buildContext)
};
}