fromJson static method

TonWalletCard? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static TonWalletCard? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return TonWalletCard(
    address: (json['address'] as String?) ?? '',
    gramAmount: (json['gram_amount'] is int
            ? json['gram_amount'] as int
            : int.tryParse(json['gram_amount']?.toString() ?? '')) ??
        0,
    stickers: List<TonWalletCardSticker>.from(
        ((json['stickers'] as List<dynamic>?) ?? <dynamic>[])
            .map((item) =>
                TonWalletCardSticker.fromJson(item as Map<String, dynamic>?))
            .toList()),
    backgroundNftAddress: (json['background_nft_address'] as String?) ?? '',
  );
}