MetaFormControl<M>.ofMSchema constructor
MetaFormControl<M>.ofMSchema (
- BuildContext context, {
- Key? widgetKey,
- required JsonPath fieldPath,
- required MSchemaForm<
MBaseModel> form, - Map<
String, dynamic> ? scope, - MetadataOverrides? overrides,
- required SunnyFormFieldState<
M> fieldState, - List<
MetaPropertyHandler> ? extraHandlers, - String? label,
- bool checkAll = true,
- String? placeholder,
- JsonPath? basePath,
Implementation
factory MetaFormControl.ofMSchema(
BuildContext context, {
Key? widgetKey,
required JsonPath fieldPath,
required MSchemaForm form,
Map<String, dynamic>? scope,
MetadataOverrides? overrides,
required SunnyFormFieldState<M> fieldState,
List<MetaPropertyHandler>? extraHandlers,
String? label,
bool checkAll = true,
String? placeholder,
JsonPath? basePath,
}) {
final metaProp = form.definition!.prop(fieldPath);
return MetaFormControl._(
widgetKey: widgetKey,
fieldPath: fieldPath,
checkAll: checkAll,
fieldState: fieldState,
metaFormField: MetaFormFieldContext(
formConfig: overrides?.formConfig?.orEmpty()[fieldPath] ?? [],
form: MetaFormContext.ofModelForm(
context,
controller: form,
embedPath: basePath,
scope: scope,
overrides: overrides,
extraHandlers: extraHandlers,
definition: form.definition!,
),
property: metaProp!,
fullPath: (basePath! + fieldPath)),
basePath: basePath.self,
label: label,
placeholder: placeholder,
);
}