TrustPinLogEvent.fromMap constructor
Decodes an event map received from the platform event channel.
Implementation
factory TrustPinLogEvent.fromMap(Map<Object?, Object?> map) {
final level = switch (map['level'] as String?) {
'error' => TrustPinLogLevel.error,
'debug' => TrustPinLogLevel.debug,
_ => TrustPinLogLevel.info,
};
return TrustPinLogEvent(
level: level,
instanceId: map['instanceId'] as String? ?? 'default',
message: map['message'] as String? ?? '',
);
}