FieldModel.fromJson constructor
Implementation
factory FieldModel.fromJson(Map<String, dynamic> json, {String? locale}) {
return FieldModel(
type: json['type'],
key: json['key'],
label: json['label'],
placeholder: json['placeholder'],
validators: List<String>.from(json['validators'] ?? []),
options: (json['options'] as List?)?.map((e) => Map<String, dynamic>.from(e)).toList(),
localization: json['localization'],
visibleWhen: json['visibleWhen'],
extra: json['extra'],
prefixIcon: json['prefixIcon'],
suffixIcon: json['suffixIcon'],
border: json['border'],
borderRadius: json['borderRadius'],
filled: json['filled'],
borderColor: json['borderColor'],
focusedBorderColor: json['focusedBorderColor'],
fillColor: json['fillColor'],
activeColor: json['activeColor'],
tileColor: json['tileColor'],
selectedTileColor: json['selectedTileColor'],
shape: json['shape'],
contentPadding: (json['contentPadding'] is num) ? (json['contentPadding'] as num).toDouble() : null,
visualDensity: (json['visualDensity'] is num) ? (json['visualDensity'] as num).toDouble() : null,
isDense: json['isDense'],
);
}