fix functional bugs
This commit is contained in:
@@ -12,6 +12,8 @@ class ActiveRideState {
|
||||
final double cost;
|
||||
final bool isPaused;
|
||||
final bool inZone;
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
|
||||
const ActiveRideState({
|
||||
this.status = ActiveRideStatus.initial,
|
||||
@@ -20,6 +22,8 @@ class ActiveRideState {
|
||||
this.elapsedTime = Duration.zero,
|
||||
this.speed = 0.0,
|
||||
this.distance = 0.0,
|
||||
this.latitude = 0.0,
|
||||
this.longitude = 0.0,
|
||||
this.cost = 0.0,
|
||||
this.isPaused = false,
|
||||
this.inZone = true,
|
||||
@@ -33,6 +37,8 @@ class ActiveRideState {
|
||||
double? speed,
|
||||
double? distance,
|
||||
double? cost,
|
||||
double? longitude,
|
||||
double? latitude,
|
||||
bool? isPaused,
|
||||
bool? inZone,
|
||||
}) {
|
||||
@@ -44,6 +50,8 @@ class ActiveRideState {
|
||||
speed: speed ?? this.speed,
|
||||
distance: distance ?? this.distance,
|
||||
cost: cost ?? this.cost,
|
||||
latitude: latitude ?? this.latitude,
|
||||
longitude: longitude ?? this.longitude,
|
||||
isPaused: isPaused ?? this.isPaused,
|
||||
inZone: inZone ?? this.inZone,
|
||||
);
|
||||
|
||||
@@ -9,6 +9,8 @@ enum ScooterStatus { initial, loading, success, failure }
|
||||
|
||||
class ScooterState {
|
||||
final List<Scooter> scooters;
|
||||
final List<Scooter> reservedScooters;
|
||||
final Scooter? selectedScooterForFocus;
|
||||
final List<Zone> zones;
|
||||
final List<double> area;
|
||||
final List<double> areaScooters;
|
||||
@@ -23,6 +25,8 @@ class ScooterState {
|
||||
|
||||
ScooterState({
|
||||
this.scooters = const [],
|
||||
this.reservedScooters = const [],
|
||||
this.selectedScooterForFocus,
|
||||
this.zones = const [],
|
||||
this.area = const [],
|
||||
this.areaScooters = const [],
|
||||
@@ -38,6 +42,8 @@ class ScooterState {
|
||||
|
||||
ScooterState copyWith({
|
||||
List<Scooter>? scooters,
|
||||
List<Scooter>? reservedScooters,
|
||||
Scooter? selectedScooterForFocus,
|
||||
List<Zone>? zones,
|
||||
List<double>? area,
|
||||
List<double>? areaScooters,
|
||||
@@ -52,6 +58,8 @@ class ScooterState {
|
||||
}) {
|
||||
return ScooterState(
|
||||
scooters: scooters ?? this.scooters,
|
||||
reservedScooters: reservedScooters ?? this.reservedScooters,
|
||||
selectedScooterForFocus: selectedScooterForFocus ?? this.selectedScooterForFocus,
|
||||
zones: zones ?? this.zones,
|
||||
area: area ?? this.area,
|
||||
areaScooters: areaScooters ?? this.areaScooters,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:be_happy/domain/entities/client_subscription.dart';
|
||||
|
||||
import '../../domain/entities/subscription.dart';
|
||||
|
||||
abstract class SubscriptionState {}
|
||||
@@ -6,7 +8,7 @@ class SubscriptionsLoading extends SubscriptionState {}
|
||||
|
||||
class SubscriptionsLoaded extends SubscriptionState {
|
||||
final List<Subscription> subscriptions;
|
||||
final List<Subscription> activeSubscriptions;
|
||||
final List<ClientSubscription> activeSubscriptions;
|
||||
|
||||
SubscriptionsLoaded({
|
||||
required this.subscriptions,
|
||||
|
||||
@@ -15,21 +15,29 @@ class DetailsContentState extends SubscriptionDetailsState {
|
||||
final Subscription subscription;
|
||||
final SubscriptionPeriod selectedPeriod;
|
||||
final bool isAgreed;
|
||||
final bool isAlreadyPurchased; // ✅ Куплена ли эта подписка сейчас
|
||||
final bool isSuccess; // ✅ Сигнал для навигатора назад
|
||||
|
||||
DetailsContentState({
|
||||
required this.subscription,
|
||||
required this.selectedPeriod,
|
||||
this.isAgreed = false,
|
||||
this.isAlreadyPurchased = false,
|
||||
this.isSuccess = false,
|
||||
});
|
||||
|
||||
DetailsContentState copyWith({
|
||||
SubscriptionPeriod? selectedPeriod,
|
||||
bool? isAgreed,
|
||||
bool? isAlreadyPurchased,
|
||||
bool? isSuccess,
|
||||
}) {
|
||||
return DetailsContentState(
|
||||
subscription: this.subscription,
|
||||
selectedPeriod: selectedPeriod ?? this.selectedPeriod,
|
||||
isAgreed: isAgreed ?? this.isAgreed,
|
||||
isAlreadyPurchased: isAlreadyPurchased ?? this.isAlreadyPurchased,
|
||||
isSuccess: isSuccess ?? this.isSuccess,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user