create promocode page
This commit is contained in:
25
lib/presentation/state/promo_code_state.dart
Normal file
25
lib/presentation/state/promo_code_state.dart
Normal 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user