SpinnerItemData.fromJson constructor

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

Implementation

factory SpinnerItemData.fromJson(Map<String, dynamic> json) {
  var entity = SpinnerItemData();
  if (json["name"] is String) {
    entity = entity.copyWith(name: json["name"]);
  }
  entity = entity.copyWith(result: json["result"]);
  if (json["selected"] is bool) {
    entity = entity.copyWith(selected: json["selected"]);
  }
  // if (json["highlighted"] is bool) {
  //   entity = entity.copyWith(highlighted: json["highlighted"]);
  // }
  if (json["isMutex"] is bool) {
    entity = entity.copyWith(isMutex: json["isMutex"]);
  }
  if (json["items"] is List) {
    entity = entity.copyWith(items: SpinnerItemData.fromList(json["items"]));
  }

  return entity;
}