export method

  1. @override
Map<String, dynamic> export(
  1. Widget? widget,
  2. BuildContext? buildContext
)
override

export the runtime widget to json

Implementation

@override
Map<String, dynamic> export(Widget? widget, BuildContext? buildContext) {
  var realWidget = widget as RaisedButton;
  var padding = realWidget.padding as EdgeInsets?;

  return <String, dynamic>{
    "type": widgetName,
    "color": realWidget.color != null
        ? realWidget.color!.value.toRadixString(16)
        : null,
    "disabledColor": realWidget.disabledColor != null
        ? realWidget.disabledColor!.value.toRadixString(16)
        : null,
    "disabledElevation": realWidget.disabledElevation,
    "disabledTextColor": realWidget.disabledTextColor != null
        ? realWidget.disabledTextColor!.value.toRadixString(16)
        : null,
    "elevation": realWidget.elevation,
    "padding": padding != null
        ? "${padding.left},${padding.top},${padding.right},${padding.bottom}"
        : null,
    "splashColor": realWidget.splashColor != null
        ? realWidget.splashColor!.value.toRadixString(16)
        : null,
    "textColor": realWidget.textColor != null
        ? realWidget.textColor!.value.toRadixString(16)
        : null,
    "child": DynamicWidgetBuilder.export(realWidget.child, buildContext)
  };
}