Compare commits
3 Commits
e5e85b68ff
...
8d7591b766
Author | SHA1 | Date | |
---|---|---|---|
8d7591b766 | |||
88d57e217f | |||
7d08f6c5cf |
@ -1,4 +1,5 @@
|
||||
// Local
|
||||
import '/models/item_type.dart';
|
||||
import '/models/tracked_item.dart';
|
||||
|
||||
class Asset extends TrackedItem {
|
||||
@ -6,6 +7,7 @@ class Asset extends TrackedItem {
|
||||
|
||||
Asset({
|
||||
super.id,
|
||||
super.type = ItemType.asset,
|
||||
required super.name,
|
||||
required super.amount,
|
||||
required super.description,
|
||||
|
@ -1,12 +1,14 @@
|
||||
// Local
|
||||
import '/models/tracked_item.dart';
|
||||
import '/models/frequency.dart';
|
||||
import '/models/item_type.dart';
|
||||
|
||||
class Income extends TrackedItem {
|
||||
static String amountText = "Revenue";
|
||||
|
||||
Income({
|
||||
super.id,
|
||||
super.type = ItemType.income,
|
||||
required super.name,
|
||||
required super.amount,
|
||||
required super.frequency,
|
||||
|
@ -103,12 +103,17 @@ class _TrackedItemPageState extends State<TrackedItemPage> {
|
||||
itemYearAmount = -1;
|
||||
estimateSymbolYearly = "";
|
||||
}
|
||||
|
||||
final String monthlyTitle = curr.type == ItemType.asset
|
||||
? ""
|
||||
: " ${Frequency.monthly.title}";
|
||||
|
||||
final String itemTopText = itemDayAmount < 0
|
||||
? ""
|
||||
: "$estimateSymbolDaily${itemDayAmount.toStringAsFixed(2)} ${Frequency.daily.title}";
|
||||
final String itemMiddleText = itemMonthAmount < 0
|
||||
? ""
|
||||
: "$estimateSymbolMonthly${itemMonthAmount.toStringAsFixed(2)} ${Frequency.monthly.title}";
|
||||
: "$estimateSymbolMonthly${itemMonthAmount.toStringAsFixed(2)}$monthlyTitle";
|
||||
final String itemBottomText = itemYearAmount < 0
|
||||
? ""
|
||||
: "$estimateSymbolYearly${itemYearAmount.toStringAsFixed(2)} ${Frequency.yearly.title}";
|
||||
@ -468,7 +473,8 @@ class _TrackedItemInputDialogState extends State<TrackedItemInputDialog> {
|
||||
onPressed: () {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
_formKey.currentState!.save();
|
||||
setState(() {
|
||||
setState(
|
||||
() {
|
||||
switch (_type) {
|
||||
case ItemType.expense:
|
||||
Expense expense = Expense(
|
||||
@ -528,9 +534,10 @@ class _TrackedItemInputDialogState extends State<TrackedItemInputDialog> {
|
||||
"No code for type ${_type!.title}",
|
||||
);
|
||||
}
|
||||
});
|
||||
widget.notifyParent();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: Icon(Icons.save),
|
||||
|
Loading…
x
Reference in New Issue
Block a user