50 lines
1.4 KiB
Dart
50 lines
1.4 KiB
Dart
part of 'budget_bloc.dart';
|
|
|
|
final class BudgetState {
|
|
final List<Budget> budgets;
|
|
final double initialBudget;
|
|
final double remainingBudget;
|
|
|
|
final List<Budget> compareBudgets;
|
|
final List<Budget> otherBudgets;
|
|
final num compareYear;
|
|
final num compareMonth;
|
|
final DateTime? firstDate;
|
|
final DateTime? lastDate;
|
|
|
|
const BudgetState({
|
|
this.budgets = const [],
|
|
this.initialBudget = 2300.0,
|
|
this.remainingBudget = 2300.0,
|
|
this.compareBudgets = const [],
|
|
this.otherBudgets = const [],
|
|
this.compareYear = 2000,
|
|
this.compareMonth = 1,
|
|
this.firstDate,
|
|
this.lastDate,
|
|
});
|
|
|
|
BudgetState copyWith({
|
|
List<Budget>? budgets,
|
|
double? initialBudget,
|
|
double? remainingBudget,
|
|
List<Budget>? compareBudgets,
|
|
List<Budget>? otherBudgets,
|
|
num? compareYear,
|
|
num? compareMonth,
|
|
DateTime? firstDate,
|
|
DateTime? lastDate,
|
|
}) {
|
|
return BudgetState(
|
|
budgets: budgets ?? this.budgets,
|
|
initialBudget: initialBudget ?? this.initialBudget,
|
|
remainingBudget: remainingBudget ?? this.remainingBudget,
|
|
compareBudgets: compareBudgets ?? this.compareBudgets,
|
|
otherBudgets: otherBudgets ?? this.otherBudgets,
|
|
compareYear: compareYear ?? this.compareYear,
|
|
compareMonth: compareMonth ?? this.compareMonth,
|
|
firstDate: firstDate ?? this.firstDate,
|
|
lastDate: lastDate ?? this.lastDate,
|
|
);
|
|
}
|
|
} |