fromMap static method

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

Construct from Map.

Implementation

static ChatType? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  switch (_) {
    case 'chatTypeSupergroup':
      return ChatTypeSupergroup.fromMap(_map);
    case 'chatTypeBasicGroup':
      return ChatTypeBasicGroup.fromMap(_map);
    case 'chatTypeSecret':
      return ChatTypeSecret.fromMap(_map);
    case 'chatTypePrivate':
      return ChatTypePrivate.fromMap(_map);
    case null:
    default:
      return null;
  }
}