buildElement method
Implementation
Widget buildElement(BuildContext context, Map<String, dynamic> element) {
switch (element["type"]) {
case ElementTypes.horizontalLayout:
return buildLayout(context, element);
case ElementTypes.verticalLayout:
return buildLayout(context, element);
case ElementTypes.control:
String scope = element["scope"] ?? "";
Control? control = Control.from(
schema: schemaGet(scope),
options: getOptions(element),
scope: scope,
isRequired: isRequired(scope),
defaultValue: getDefaultValue(scope),
onValueChanged: getValueChanged(scope),
);
if (control == null) {
return Container();
}
widget._controls.add(control);
return control;
default:
return Container();
}
}