NiceJsonSchemaForm.fromJson constructor
Factory constructor from JSON string.
Implementation
factory NiceJsonSchemaForm.fromJson(
String jsonSchema, {
Key? key,
String? uiSchemaJson,
Map<String, dynamic>? initialValues,
void Function(Map<String, dynamic> values)? onChanged,
void Function(Map<String, dynamic> values)? onSubmit,
String? submitLabel,
bool readOnly = false,
int columnsPerRow = 1,
}) {
return NiceJsonSchemaForm(
key: key,
schema: json.decode(jsonSchema) as Map<String, dynamic>,
uiSchema: uiSchemaJson != null
? json.decode(uiSchemaJson) as Map<String, dynamic>
: const {},
initialValues: initialValues,
onChanged: onChanged,
onSubmit: onSubmit,
submitLabel: submitLabel,
readOnly: readOnly,
columnsPerRow: columnsPerRow,
);
}