fromMap static method
override
Construct from Map.
Implementation
static PremiumState? 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 state = FormattedText.fromMap(_map['state'])!;
var payment_options = List<PremiumStatePaymentOption>.from(
(_map["payment_options"] ?? []).map(
(e) => PremiumStatePaymentOption.fromMap(e),
),
);
var animations = List<PremiumFeaturePromotionAnimation>.from(
(_map["animations"] ?? []).map(
(e) => PremiumFeaturePromotionAnimation.fromMap(e),
),
);
return PremiumState(
extra: extra,
clientId: clientId,
state: state,
payment_options: payment_options,
animations: animations,
);
}