new project stable version
This commit is contained in:
27
lib/presentation/state/scooter_detail_state.dart
Normal file
27
lib/presentation/state/scooter_detail_state.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import '../../domain/entities/scooter.dart';
|
||||
|
||||
enum ScooterStatus { initial, loading, success, failure }
|
||||
|
||||
class ScooterDetailState {
|
||||
final ScooterStatus status;
|
||||
final Scooter? scooter;
|
||||
final String? errorMessage;
|
||||
|
||||
const ScooterDetailState({
|
||||
this.status = ScooterStatus.initial,
|
||||
this.scooter,
|
||||
this.errorMessage,
|
||||
});
|
||||
|
||||
ScooterDetailState copyWith({
|
||||
ScooterStatus? status,
|
||||
Scooter? scooter,
|
||||
String? errorMessage,
|
||||
}) {
|
||||
return ScooterDetailState(
|
||||
status: status ?? this.status,
|
||||
scooter: scooter ?? this.scooter,
|
||||
errorMessage: errorMessage ?? this.errorMessage,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user