toMap method

  1. @override
Map<String, dynamic> toMap()

Converts the BaseDataModel object to a Map representation.

Returns a Map containing the key-value pairs of the object's properties.

Implementation

@override
Map<String, dynamic> toMap() {
  return <String, dynamic>{
    'notificationId': notificationId.toSerializable,
    'status': status.name.toSerializable,
    'timestamp': timestamp.toSerializable,
    'errorMessage': errorMessage?.toSerializable,
    'retryCount': retryCount.toSerializable,
    'deliveredAt': deliveredAt?.toSerializable,
    'openedAt': openedAt?.toSerializable,
    'dismissedAt': dismissedAt?.toSerializable,
    'metadata': metadata.toSerializable,
  };
}