32 lines
873 B
Dart
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;
|
|
}
|