43 lines
1.2 KiB
Dart
43 lines
1.2 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:proxibuy/domain/entities/category_entity.dart';
|
|
|
|
class NotificationPreferencesState extends Equatable {
|
|
final List<CategoryEntity> categories;
|
|
final Set<String> selectedCategoryIds;
|
|
final bool isLoading;
|
|
final String? errorMessage;
|
|
final bool submissionSuccess;
|
|
|
|
const NotificationPreferencesState({
|
|
this.categories = const [],
|
|
this.selectedCategoryIds = const {},
|
|
this.isLoading = false,
|
|
this.errorMessage,
|
|
this.submissionSuccess = false,
|
|
});
|
|
|
|
NotificationPreferencesState copyWith({
|
|
List<CategoryEntity>? categories,
|
|
Set<String>? selectedCategoryIds,
|
|
bool? isLoading,
|
|
String? errorMessage,
|
|
bool? submissionSuccess,
|
|
}) {
|
|
return NotificationPreferencesState(
|
|
categories: categories ?? this.categories,
|
|
selectedCategoryIds: selectedCategoryIds ?? this.selectedCategoryIds,
|
|
isLoading: isLoading ?? this.isLoading,
|
|
errorMessage: errorMessage,
|
|
submissionSuccess: submissionSuccess ?? this.submissionSuccess,
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
categories,
|
|
selectedCategoryIds,
|
|
isLoading,
|
|
errorMessage,
|
|
submissionSuccess,
|
|
];
|
|
} |