markNotificationAsRead method

  1. @override
Future<Notification> markNotificationAsRead(
  1. Notification notification
)
override

Marks the given notification as read.

Implementation

@override
Future<Notification> markNotificationAsRead(Notification notification) async {
  if (notification.read) {
    return notification;
  }

  return notificationsDataSource.updateNotification(notification.copyWith(
    readAsInt: 1,
    readAtTimestamp: DateTime.now().millisecondsSinceEpoch,
  ));
}