SubscribedTopcis.fromJson constructor

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

Implementation

factory SubscribedTopcis.fromJson(Map<String, dynamic> json) {
  final Map<String, dynamic> map = json["rel"]["topics"];

  return SubscribedTopcis(
    topics: (map.keys.map(
      (key) {
        return Topics(
            topic: key,
            addDate: DateTime.tryParse(map[key]?["addDate"] ?? ""));
      },
    ).toList()),
  );
}