CollectionToggle.fromJson constructor

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

Implementation

factory CollectionToggle.fromJson(Map<String, dynamic> json) {
  final key = json["collectionToggle"]["key"];
  final List<dynamic> value = json["collectionToggle"]["value"];
  switch (key) {
    case "NoneLayout":
      return none;
    case "Clear":
      return clear;
    default:
      return CollectionToggle.set(collection: Collection.fromJson(value[0]));
  }
}