fromMap static method

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

Construct from Map.

Implementation

static CreateNewSupergroupChat? 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 title = _map['title']! as String;
  var is_forum = _map['is_forum']! as bool;
  var is_channel = _map['is_channel']! as bool;
  var description = _map['description']! as String;
  var location = ChatLocation.fromMap(_map['location']);
  var message_auto_delete_time = _map['message_auto_delete_time']! as int;
  var for_import = _map['for_import']! as bool;
  return CreateNewSupergroupChat(
    extra: extra,
    clientId: clientId,
    title: title,
    is_forum: is_forum,
    is_channel: is_channel,
    description: description,
    location: location,
    message_auto_delete_time: message_auto_delete_time,
    for_import: for_import,
  );
}