EphemeralKey.fromJson constructor

EphemeralKey.fromJson(
  1. Object? json
)

Implementation

factory EphemeralKey.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return EphemeralKey(
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    expires:
        DateTime.fromMillisecondsSinceEpoch((map['expires'] as int).toInt()),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    secret: map['secret'] == null ? null : (map['secret'] as String),
  );
}