TrustPinValidationEvent.fromMap constructor

TrustPinValidationEvent.fromMap(
  1. Map<Object?, Object?> map
)

Decodes an event map received from the platform event channel.

Implementation

factory TrustPinValidationEvent.fromMap(Map<Object?, Object?> map) {
  final code = map['code'] as String?;
  return TrustPinValidationEvent(
    instanceId: map['instanceId'] as String? ?? 'default',
    domain: map['domain'] as String? ?? '',
    error: code == null
        ? null
        : TrustPinException(code, map['message'] as String? ?? ''),
    certificatePem: map['certificatePem'] as String?,
  );
}