FieldMetadata.fromJson constructor

FieldMetadata.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory FieldMetadata.fromJson(Map<String, Object?> json) {
  return FieldMetadata(
    required: json[r'required'] as bool? ?? false,
    schema: json[r'schema'] as Map<String, Object?>? ?? {},
    name: json[r'name'] as String? ?? '',
    key: json[r'key'] as String? ?? '',
    autoCompleteUrl: json[r'autoCompleteUrl'] as String?,
    hasDefaultValue: json[r'hasDefaultValue'] as bool? ?? false,
    operations: (json[r'operations'] as List<Object?>?)
            ?.map((i) => i as String? ?? '')
            .toList() ??
        [],
    allowedValues:
        (json[r'allowedValues'] as List<Object?>?)?.map((i) => i).toList() ??
            [],
    defaultValue: json[r'defaultValue'],
    configuration: json[r'configuration'] as Map<String, Object?>?,
  );
}