KfInputField.fromJson constructor

KfInputField.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory KfInputField.fromJson(Map<String, dynamic> json) {
  final rawOptions = json['options'];
  return KfInputField(
    id: json['id'] as String,
    type: json['type'] as String,
    label: _toTitleCase(json['label'] as String),
    required: json['required'] == true,
    options: rawOptions is List
        ? rawOptions.map((e) => e.toString()).toList()
        : const [],
    isKpStandard: json['is_kp_standard'] == true,
  );
}