parseFields static method
Implementation
static List<FieldModel> parseFields(dynamic schema, {String? locale}) {
Map<String, dynamic> json;
if (schema is String) {
json = jsonDecode(schema);
} else if (schema is Map<String, dynamic>) {
json = schema;
} else {
throw ArgumentError('Schema must be a JSON string or Map');
}
final fields = (json['fields'] as List?) ?? [];
return fields.map((f) => FieldModel.fromJson(f, locale: locale)).toList();
}