UserFlowField.fromJson constructor
UserFlowField.fromJson(
- Map<String, dynamic> json
)
Implementation
factory UserFlowField.fromJson(Map<String, dynamic> json) => UserFlowField(
fieldName: json["fieldName"],
label: json["label"],
type: UFieldType.values.firstWhere(
(UFieldType e) => e.name == json["type"],
orElse: () => UFieldType.text,
),
isRequired: json["isRequired"] ?? true,
hint: json["hint"],
placeholder: json["placeholder"],
defaultValue: json["defaultValue"],
isDisabled: json["isDisabled"] ?? false,
isReadOnly: json["isReadOnly"] ?? false,
isHidden: json["isHidden"] ?? false,
validation: json["validation"] != null ? UValidationRules.fromJson(json["validation"]) : null,
options: json["options"] != null ? (json["options"] as List<dynamic>).map((dynamic e) => USelectOption.fromJson(e)).toList() : null,
dynamicOptions: json["dynamicOptions"] != null ? UDynamicOptionsConfig.fromJson(json["dynamicOptions"]) : null,
dependency: json["dependency"] != null ? UDependencyRule.fromJson(json["dependency"]) : null,
visibility: json["visibility"] != null ? UVisibilityRule.fromJson(json["visibility"]) : null,
apiEndpoint: json["apiEndpoint"],
httpMethod: json["httpMethod"] ?? "PUT",
apiHeaders: json["apiHeaders"] != null ? Map<String, String>.from(json["apiHeaders"]) : null,
onApiResponse: json["onApiResponse"] != null ? UApiAction.fromJson(json["onApiResponse"]) : null,
debounceMs: json["debounceMs"],
autoSave: json["autoSave"] ?? true,
cssClass: json["cssClass"],
width: UFieldWidth.values.firstWhere(
(UFieldWidth e) => e.name == json["width"],
orElse: () => UFieldWidth.full,
),
order: json["order"] ?? 0,
);