new project stable version
This commit is contained in:
27
lib/presentation/state/current_rides_state.dart
Normal file
27
lib/presentation/state/current_rides_state.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import '../../domain/entities/scooter_order.dart';
|
||||
|
||||
enum CurrentRidesStatus { initial, loading, success, failure }
|
||||
|
||||
class CurrentRidesState {
|
||||
final CurrentRidesStatus status;
|
||||
final List<ScooterOrder> orders;
|
||||
final String? errorMessage;
|
||||
|
||||
const CurrentRidesState({
|
||||
this.status = CurrentRidesStatus.initial,
|
||||
this.orders = const [],
|
||||
this.errorMessage,
|
||||
});
|
||||
|
||||
CurrentRidesState copyWith({
|
||||
CurrentRidesStatus? status,
|
||||
List<ScooterOrder>? orders,
|
||||
String? errorMessage,
|
||||
}) {
|
||||
return CurrentRidesState(
|
||||
status: status ?? this.status,
|
||||
orders: orders ?? this.orders,
|
||||
errorMessage: errorMessage ?? this.errorMessage,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user