fromMap static method

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

Construct from Map.

Implementation

static SponsoredMessages? 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 messages = List<SponsoredMessage>.from(
    (_map["messages"] ?? []).map(
      (e) => SponsoredMessage.fromMap(e),
    ),
  );
  var messages_between = _map['messages_between']! as int;
  return SponsoredMessages(
    extra: extra,
    clientId: clientId,
    messages: messages,
    messages_between: messages_between,
  );
}