Add TODO, format code.
This commit is contained in:
parent
f5f153f692
commit
7a3eaf70b5
@ -6,6 +6,8 @@ import 'package:flutter_expense_tracker/db.dart';
|
||||
import '/models/expense.dart';
|
||||
import '/models/frequency.dart';
|
||||
|
||||
// TODO: Make this a generic class based on a suerclass of Expense, Income, and Assets?
|
||||
|
||||
class ExpensePage extends StatefulWidget {
|
||||
const ExpensePage({
|
||||
super.key,
|
||||
@ -261,7 +263,8 @@ class _ExpenseInputDialogState extends State<ExpenseInputDialog> {
|
||||
if (value!.isEmpty) {
|
||||
return "Name must be provided.";
|
||||
}
|
||||
if (!expenses.every((expense) => expense.name != value || expense.id == _id)) {
|
||||
if (!expenses.every((expense) =>
|
||||
expense.name != value || expense.id == _id)) {
|
||||
return "Name must be unique, already in use.";
|
||||
}
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user