create promocode page

This commit is contained in:
2026-06-01 14:35:46 +03:00
parent 134ffdde60
commit 0b6757e26f
13 changed files with 343 additions and 112 deletions

View File

@@ -0,0 +1,25 @@
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,
);
}
}