ProtocolsListData.fromJson constructor

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

Implementation

factory ProtocolsListData.fromJson(Map<String, dynamic> json) {
  return ProtocolsListData(
    listName: json['ListName'] as String,
    protocolsList: (json['ProtocolsList'] as List)
        .whereNotNull()
        .map((e) => e as String)
        .toList(),
    createTime: timeStampFromJson(json['CreateTime']),
    lastUpdateTime: timeStampFromJson(json['LastUpdateTime']),
    listId: json['ListId'] as String?,
    listUpdateToken: json['ListUpdateToken'] as String?,
    previousProtocolsList: (json['PreviousProtocolsList']
            as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(
            k, (e as List).whereNotNull().map((e) => e as String).toList())),
  );
}