Files
be_happy_public/lib/presentation/state/promo_code_state.dart
2026-06-01 14:35:46 +03:00

25 lines
588 B
Dart

enum PromoCodeStatus { initial, loading, success, failure }
class PromoCodeState {
final PromoCodeStatus status;
final double? newBalance;
final String? errorMessage;
const PromoCodeState({
this.status = PromoCodeStatus.initial,
this.newBalance,
this.errorMessage,
});
PromoCodeState copyWith({
PromoCodeStatus? status,
double? newBalance,
String? errorMessage,
}) {
return PromoCodeState(
status: status ?? this.status,
newBalance: newBalance ?? this.newBalance,
errorMessage: errorMessage ?? this.errorMessage,
);
}
}