fix
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:be_happy/domain/entities/payment_card.dart';
|
||||
import 'package:be_happy/domain/entities/subscription.dart';
|
||||
|
||||
import '../../domain/entities/subscription_period.dart';
|
||||
@@ -8,19 +9,24 @@ class DetailsLoading extends SubscriptionDetailsState {}
|
||||
|
||||
class DetailsError extends SubscriptionDetailsState {
|
||||
final String message;
|
||||
|
||||
DetailsError(this.message);
|
||||
}
|
||||
|
||||
class DetailsContentState extends SubscriptionDetailsState {
|
||||
final Subscription subscription;
|
||||
final SubscriptionPeriod selectedPeriod;
|
||||
final List<PaymentCard> cards;
|
||||
final PaymentCard selectedCard;
|
||||
final bool isAgreed;
|
||||
final bool isAlreadyPurchased; // ✅ Куплена ли эта подписка сейчас
|
||||
final bool isSuccess; // ✅ Сигнал для навигатора назад
|
||||
final bool isAlreadyPurchased;
|
||||
final bool isSuccess;
|
||||
|
||||
DetailsContentState({
|
||||
required this.subscription,
|
||||
required this.selectedPeriod,
|
||||
required this.selectedCard,
|
||||
this.cards = const [],
|
||||
this.isAgreed = false,
|
||||
this.isAlreadyPurchased = false,
|
||||
this.isSuccess = false,
|
||||
@@ -28,6 +34,7 @@ class DetailsContentState extends SubscriptionDetailsState {
|
||||
|
||||
DetailsContentState copyWith({
|
||||
SubscriptionPeriod? selectedPeriod,
|
||||
PaymentCard? selectedCard,
|
||||
bool? isAgreed,
|
||||
bool? isAlreadyPurchased,
|
||||
bool? isSuccess,
|
||||
@@ -35,9 +42,10 @@ class DetailsContentState extends SubscriptionDetailsState {
|
||||
return DetailsContentState(
|
||||
subscription: this.subscription,
|
||||
selectedPeriod: selectedPeriod ?? this.selectedPeriod,
|
||||
selectedCard: selectedCard ?? this.selectedCard,
|
||||
isAgreed: isAgreed ?? this.isAgreed,
|
||||
isAlreadyPurchased: isAlreadyPurchased ?? this.isAlreadyPurchased,
|
||||
isSuccess: isSuccess ?? this.isSuccess,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user