new project stable version
This commit is contained in:
38
lib/presentation/state/payment_methods_state.dart
Normal file
38
lib/presentation/state/payment_methods_state.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import '../../domain/entities/payment_card.dart';
|
||||
|
||||
enum PaymentMethodsStatus { initial, loading, success, failure }
|
||||
|
||||
class PaymentMethodsState {
|
||||
final PaymentMethodsStatus status;
|
||||
final List<PaymentCard> cards;
|
||||
final int balance;
|
||||
final String? errorMessage;
|
||||
final bool isDeleting;
|
||||
final bool isSettingMain;
|
||||
|
||||
PaymentMethodsState({
|
||||
this.status = PaymentMethodsStatus.initial,
|
||||
this.cards = const [],
|
||||
this.balance = 99,
|
||||
this.errorMessage,
|
||||
this.isDeleting = false,
|
||||
this.isSettingMain = false,
|
||||
});
|
||||
|
||||
PaymentMethodsState copyWith({
|
||||
PaymentMethodsStatus? status,
|
||||
List<PaymentCard>? cards,
|
||||
int? balance,
|
||||
String? errorMessage,
|
||||
bool? isDeleting,
|
||||
bool? isSettingMain,
|
||||
}) =>
|
||||
PaymentMethodsState(
|
||||
status: status ?? this.status,
|
||||
cards: cards ?? this.cards,
|
||||
balance: balance ?? this.balance,
|
||||
errorMessage: errorMessage ?? this.errorMessage,
|
||||
isDeleting: isDeleting ?? this.isDeleting,
|
||||
isSettingMain: isSettingMain ?? this.isSettingMain,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user