Variable.fromJson constructor

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

Implementation

factory Variable.fromJson(Map<String, Object?> json) => Variable(
      about: json["about"] == null ? null : json["about"] as String,
      defaultValue: json["default"],
      items: json["items"] == null
          ? null
          : (json["items"] as List)
              .map(
                (item) => VariableItem.fromJson(
                  (item as Map).cast<String, Object?>(),
                ),
              )
              .toList(),
      name: json["name"] as String,
      requiredValue: json["required"] as bool,
      type: VariableType.fromJson(json["type"]),
    );