initialize static method
Initializes the ComponentFactory with custom component builders.
Use this method to register custom component types or override the default implementation of existing components.
Example:
void main() {
ComponentFactory.initialize({
'textfield': FunctionComponentBuilder((context) {
return MyCustomTextField(
component: context.component,
value: context.value,
onChanged: context.onChanged,
);
}),
'mycustomtype': FunctionComponentBuilder((context) {
return MyCustomComponent(
component: context.component,
value: context.value,
onChanged: context.onChanged,
);
}),
});
runApp(MyApp());
}
componentBuilders A map of component type strings to their builders.
Implementation
static void initialize(Map<String, FormioComponentBuilder> componentBuilders) {
_customComponents.addAll(componentBuilders);
}