fromMap static method

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

Implementation

static TransactionNetworkStatusCheckedEvent fromMap(Map<String, dynamic> map) =>
    TransactionNetworkStatusCheckedEvent(
      walletId: map['walletId'] as String,
      txid: map['txid'] as String,
      networkStatus: map['networkStatus'] as String,
      source: map['source'] as String? ?? 'arc',
      checkedAt: _deferredDate(map['checkedAt']) ?? DateTime.fromMillisecondsSinceEpoch(0),
      blockHeight: map['blockHeight'] as int?,
      explicit: map['explicit'] as bool? ?? false,
      competingTxids: [
        if (map['competingTxids'] case final List<dynamic> txids)
          for (final txid in txids) txid.toString(),
      ],
      eventId: map['eventId'] as String?,
      timestamp: _deferredDate(map['timestamp']),
      version: map['version'] as int?,
      metadata: map['metadata'] as Map<String, dynamic>?,
    );