Fix order of cost validations to properly show error for character data.
This commit is contained in:
1 parent
ab9b3e0bf9
commit
3bf3dd3190
1 file changed
+3
-3
@@ -289,15 +289,15 @@ class _ExpenseInputDialogState extends State<ExpenseInputDialog> {
|
||||
if (value == null || value.isEmpty) {
|
||||
return "${Expense.amountText} must be provided.";
|
||||
}
|
||||
if (double.tryParse(value) == null) {
|
||||
return "${Expense.amountText} must be a valid number.";
|
||||
}
|
||||
if (double.parse(value) < 0) {
|
||||
return "Please use the Income page rather than having negative expenses.";
|
||||
}
|
||||
if (double.parse(value) < 0.01) {
|
||||
return "${Expense.amountText} must be one hundreth (0.01) or higher.";
|
||||
}
|
||||
if (double.tryParse(value) == null) {
|
||||
return "${Expense.amountText} must be a valid number.";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onSaved: (value) {
|
||||
|
||||
Reference in new issue
Block a user