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:
        int.tryParse(
          (json['software_icon_custom_emoji_id'] as dynamic)?.toString() ??
              '',
        ) ??
        0,
  );
}