fromMap static method

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

Construct from Map.

Implementation

static PremiumFeatures? 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 features = List<PremiumFeature>.from(
    (_map["features"] ?? []).map(
      (e) => PremiumFeature.fromMap(e),
    ),
  );
  var limits = List<PremiumLimit>.from(
    (_map["limits"] ?? []).map(
      (e) => PremiumLimit.fromMap(e),
    ),
  );
  var payment_link = InternalLinkType.fromMap(_map['payment_link']);
  return PremiumFeatures(
    extra: extra,
    clientId: clientId,
    features: features,
    limits: limits,
    payment_link: payment_link,
  );
}