fromMap static method

NotificationGroup? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static NotificationGroup? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var id = _map['id']! as int;
  var type = NotificationGroupType.fromMap(_map['type'])!;
  var chat_id = _map['chat_id']! as int;
  var total_count = _map['total_count']! as int;
  var notifications = List<Notification>.from(
    (_map["notifications"] ?? []).map(
      (e) => Notification.fromMap(e),
    ),
  );
  return NotificationGroup(
    extra: extra,
    clientId: clientId,
    id: id,
    type: type,
    chat_id: chat_id,
    total_count: total_count,
    notifications: notifications,
  );
}