fromMap static method

AddressGeneratedEvent fromMap(
  1. Map<String, dynamic> map
)

Create event from a map during deserialization This is a factory method that should be implemented by concrete event classes

Implementation

static AddressGeneratedEvent fromMap(Map<String, dynamic> map) {
  return AddressGeneratedEvent(
    walletId: map['walletId'] as String,
    address: map['address'] as String,
    derivationIndex: map['derivationIndex'] as int,
    label: map['label'] as String?,
    purpose: map['purpose'] as String?,
    publicKeyHex: map['publicKeyHex'] as String?,
    correlationId: map['correlationId'] as String? ?? map['metadata']?['correlationId'] as String?,
    eventId: map['eventId'] as String?,
    timestamp: map['timestamp'] != null
        ? (map['timestamp'] is String
            ? DateTime.parse(map['timestamp'] as String)
            : map['timestamp'] as DateTime)
        : null,
    version: map['version'] as int?,
    metadata: map['metadata'] as Map<String, dynamic>?,
  );
}