Channel.fromMap constructor

Channel.fromMap(
  1. Map<String, dynamic>? json
)

Implementation

Channel.fromMap(Map<String, dynamic>? json) {
  if (json != null) {
    id = json['_id'];
    name = json['name'];
    t = json['t'];
    usernames = List<String>.from(json['usernames']);
    msgs = json['msgs'];
    user = json['u'] != null ? User.fromMap(json['u']) : null;
    ts = DateTime.parse(json['ts']);
  }
}