new project stable version
This commit is contained in:
31
lib/presentation/state/send_photo_state.dart
Normal file
31
lib/presentation/state/send_photo_state.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user