createWidget method
Creates a Widget based on its spec
.
Implementation
@protected
Widget createWidget(BuildContext context, WidgetNodeSpec spec, Map state,
Map? parentContext) {
if (!EditorBloc.editMode && spec.props["buildCondition"] != null) {
if (!properties.build(
Types.kCondition.type, spec.props["buildCondition"])) {
return const NoWidget();
}
}
if (!_widgetBuilders.containsKey(spec.type)) {
log.severe("Widget builder for type '${spec.type}' not found");
return const SizedBox();
}
final params = BuildParameters(context, spec, state, parentContext);
return _widgetBuilders[spec.type]!(params);
}