Files
flux/lib/features/notes/blocs/notes_state.dart
2026-05-30 18:06:43 +02:00

31 lines
675 B
Dart

part of 'notes_cubit.dart';
enum NotesStatus { initial, loading, success, failure }
class NotesState extends Equatable {
final NotesStatus status;
final List<NoteModel> notes;
final String? errorMessage;
const NotesState({
this.status = NotesStatus.initial,
this.notes = const [],
this.errorMessage,
});
NotesState copyWith({
NotesStatus? status,
List<NoteModel>? notes,
String? errorMessage,
}) {
return NotesState(
status: status ?? this.status,
notes: notes ?? this.notes,
errorMessage: errorMessage ?? this.errorMessage,
);
}
@override
List<Object?> get props => [status, notes, errorMessage];
}