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