build method

  1. @nonVirtual
Widget build({
  1. required ChildWidgetBuilder? childBuilder,
  2. required BuildContext context,
  3. required JsonWidgetData data,
})
inherited

Builds the widget. If there are dynamic keys on the data object, and the widget is not a PreferredSizeWidget, then the returned widget will be wrapped by a stateful widget that will rebuild if any of the dynamic args change in value.

Implementation

@nonVirtual
Widget build({
  required ChildWidgetBuilder? childBuilder,
  required BuildContext context,
  required JsonWidgetData data,
}) {
  late Widget result;

  if (preferredSizeWidget == true || data.jsonWidgetListenVariables.isEmpty) {
    result = _buildWidget(
      childBuilder: childBuilder,
      context: context,
      data: data,
    );
  } else {
    result = _JsonWidgetStateful(
      childBuilder: childBuilder,
      customBuilder: _buildWidget,
      data: data,
      key: ValueKey('json_widget_stateful.${data.jsonWidgetId}'),
    );
  }

  return result;
}