Compare commits
No commits in common. "8d7591b7666d1d73668c0407923d5496a467451c" and "e5e85b68ff62eb6552164220692edd3b34d5c7da" have entirely different histories.
8d7591b766
...
e5e85b68ff
@ -1,5 +1,4 @@
|
||||
// Local
|
||||
import '/models/item_type.dart';
|
||||
import '/models/tracked_item.dart';
|
||||
|
||||
class Asset extends TrackedItem {
|
||||
@ -7,7 +6,6 @@ class Asset extends TrackedItem {
|
||||
|
||||
Asset({
|
||||
super.id,
|
||||
super.type = ItemType.asset,
|
||||
required super.name,
|
||||
required super.amount,
|
||||
required super.description,
|
||||
|
@ -1,14 +1,12 @@
|
||||
// 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,17 +103,12 @@ 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)}$monthlyTitle";
|
||||
: "$estimateSymbolMonthly${itemMonthAmount.toStringAsFixed(2)} ${Frequency.monthly.title}";
|
||||
final String itemBottomText = itemYearAmount < 0
|
||||
? ""
|
||||
: "$estimateSymbolYearly${itemYearAmount.toStringAsFixed(2)} ${Frequency.yearly.title}";
|
||||
@ -473,8 +468,7 @@ class _TrackedItemInputDialogState extends State<TrackedItemInputDialog> {
|
||||
onPressed: () {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
_formKey.currentState!.save();
|
||||
setState(
|
||||
() {
|
||||
setState(() {
|
||||
switch (_type) {
|
||||
case ItemType.expense:
|
||||
Expense expense = Expense(
|
||||
@ -534,10 +528,9 @@ 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