fromMap static method

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

Construct from Map.

Implementation

static ChatBoostStatus? 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 is_boosted = _map['is_boosted']! as bool;
  var level = _map['level']! as int;
  var boost_count = _map['boost_count']! as int;
  var current_level_boost_count = _map['current_level_boost_count']! as int;
  var next_level_boost_count = _map['next_level_boost_count']! as int;
  var premium_member_count = _map['premium_member_count']! as int;
  var premium_member_percentage =
      _map['premium_member_percentage']! as double;
  return ChatBoostStatus(
    extra: extra,
    clientId: clientId,
    is_boosted: is_boosted,
    level: level,
    boost_count: boost_count,
    current_level_boost_count: current_level_boost_count,
    next_level_boost_count: next_level_boost_count,
    premium_member_count: premium_member_count,
    premium_member_percentage: premium_member_percentage,
  );
}