build method
Widget
build({
- required ChildWidgetBuilder? childBuilder,
- required BuildContext context,
- required JsonWidgetData data,
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.listenVariables.isNotEmpty != true) {
result = _buildWidget(
childBuilder: childBuilder,
context: context,
data: data,
);
} else {
result = _JsonWidgetStateful(
childBuilder: childBuilder,
customBuilder: _buildWidget,
data: data,
key: ValueKey('json_widget_stateful.${data.id}'),
);
}
return result;
}