new project stable version
This commit is contained in:
40
lib/presentation/state/tariff_sheet_state.dart
Normal file
40
lib/presentation/state/tariff_sheet_state.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'package:be_happy/domain/entities/payment_card.dart';
|
||||
|
||||
import '../../domain/entities/tariff.dart';
|
||||
|
||||
enum TariffSheetStatus { initial, loading, success, failure }
|
||||
|
||||
class TariffSheetState {
|
||||
final TariffSheetStatus status;
|
||||
final List<Tariff> tariffs;
|
||||
final String? errorMessage;
|
||||
final PaymentCard? selectedCard;
|
||||
final int userBalance;
|
||||
final bool useBalance ;
|
||||
|
||||
TariffSheetState({
|
||||
this.status = TariffSheetStatus.initial,
|
||||
this.tariffs = const [],
|
||||
this.selectedCard,
|
||||
this.errorMessage,
|
||||
this.userBalance = 0,
|
||||
this.useBalance = false,
|
||||
});
|
||||
|
||||
TariffSheetState copyWith({
|
||||
TariffSheetStatus? status,
|
||||
List<Tariff>? tariffs,
|
||||
PaymentCard? selectedCard,
|
||||
String? errorMessage,
|
||||
int? userBalance,
|
||||
bool? useBalance,
|
||||
|
||||
}) => TariffSheetState(
|
||||
status: status ?? this.status,
|
||||
tariffs: tariffs ?? this.tariffs,
|
||||
selectedCard: selectedCard ?? this.selectedCard,
|
||||
useBalance: useBalance ?? this.useBalance,
|
||||
userBalance: userBalance ?? this.userBalance,
|
||||
errorMessage: errorMessage ?? this.errorMessage,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user