new project stable version
This commit is contained in:
35
lib/presentation/state/susbcription_details_state.dart
Normal file
35
lib/presentation/state/susbcription_details_state.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
import 'package:be_happy/domain/entities/subscription.dart';
|
||||
|
||||
import '../../domain/entities/subscription_period.dart';
|
||||
|
||||
abstract class SubscriptionDetailsState {}
|
||||
|
||||
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 bool isAgreed;
|
||||
|
||||
DetailsContentState({
|
||||
required this.subscription,
|
||||
required this.selectedPeriod,
|
||||
this.isAgreed = false,
|
||||
});
|
||||
|
||||
DetailsContentState copyWith({
|
||||
SubscriptionPeriod? selectedPeriod,
|
||||
bool? isAgreed,
|
||||
}) {
|
||||
return DetailsContentState(
|
||||
subscription: this.subscription,
|
||||
selectedPeriod: selectedPeriod ?? this.selectedPeriod,
|
||||
isAgreed: isAgreed ?? this.isAgreed,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user