forked from eatvio/eatvio_app
23 lines
761 B
Dart
23 lines
761 B
Dart
import 'package:eatvio_app/features/notifications/models/notification_model.dart';
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'notifications_state.freezed.dart';
|
|
|
|
@freezed
|
|
abstract class NotificationsState with _$NotificationsState {
|
|
const factory NotificationsState() = _NotificationsState;
|
|
|
|
const factory NotificationsState.empty() = NotificationsStateEmpty;
|
|
|
|
const factory NotificationsState.loaded({
|
|
required List<BaseNotificationModel> notifications,
|
|
required int notificationsCount,
|
|
@Default(false) bool isLoading,
|
|
@Default(false) bool hasUnreadNotifications,
|
|
}) = NotificationsStateLoaded;
|
|
|
|
const factory NotificationsState.error({
|
|
required String errorMessage,
|
|
}) = NotificationsStateError;
|
|
}
|