fromJson static method

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

Implementation

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

  return Passkey(
    id: (json['id'] as String?) ?? '',
    name: (json['name'] as String?) ?? '',
    additionDate: (json['addition_date'] as int?) ?? 0,
    lastUsageDate: (json['last_usage_date'] as int?) ?? 0,
    softwareIconCustomEmojiId: (json['software_icon_custom_emoji_id'] is int
            ? json['software_icon_custom_emoji_id'] as int
            : int.tryParse(
                json['software_icon_custom_emoji_id']?.toString() ?? '')) ??
        0,
  );
}