Files
be_happy_public/lib/presentation/state/send_photo_state.dart
2026-05-12 12:02:40 +03:00

32 lines
873 B
Dart

enum SendPhotoStatus { initial, loading, success, failure }
class SendPhotoState {
final SendPhotoStatus status;
final List<String> selectedImages;
final List<int> recievedPhotoIds;
final String errorMessage;
const SendPhotoState({
this.status = SendPhotoStatus.initial,
this.selectedImages = const [],
this.recievedPhotoIds = const [],
this.errorMessage = '',
});
SendPhotoState copyWith({
SendPhotoStatus? status,
List<String>? selectedImages,
List<int>? recievedPhotoIds,
String? errorMessage,
}) {
return SendPhotoState(
status: status ?? this.status,
selectedImages: selectedImages ?? this.selectedImages,
recievedPhotoIds: recievedPhotoIds ?? this.recievedPhotoIds,
errorMessage: errorMessage ?? this.errorMessage,
);
}
bool get hasSelectedImages => selectedImages.isNotEmpty;
}