fromJson static method

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

Implementation

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

  return TonConnectChallenge(
    challenge: (json['challenge'] as String?) ?? '',
    eventId: (json['event_id'] is int
            ? json['event_id'] as int
            : int.tryParse(json['event_id']?.toString() ?? '')) ??
        0,
  );
}