diff --git a/lib/main.dart b/lib/main.dart index babf2ba..7825e99 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -16,11 +16,11 @@ class MainApp extends StatelessWidget { const inputHeight = 50.0; const recurrenceValues = [ - DropdownMenuEntry(value: "D", label: "Daily"), - DropdownMenuEntry(value: "W", label: "Weekly"), - DropdownMenuEntry(value: "B", label: "Biweekly"), - DropdownMenuEntry(value: "M", label: "Monthly"), - DropdownMenuEntry(value: "Y", label: "Yearly") + DropdownMenuEntry(value: Recurrence.daily, label: "Daily"), + DropdownMenuEntry(value: Recurrence.weekly, label: "Weekly"), + DropdownMenuEntry(value: Recurrence.biweekly, label: "Biweekly"), + DropdownMenuEntry(value: Recurrence.montly, label: "Monthly"), + DropdownMenuEntry(value: Recurrence.yearly, label: "Yearly") ]; var cost; @@ -66,10 +66,19 @@ class MainApp extends StatelessWidget { } } +// https://www.tutorialspoint.com/dart_programming/dart_programming_enumeration.htm +enum Recurrence { + daily, + weekly, + biweekly, + montly, + yearly +} + class Expense { String name; double cost; - Enum recurrence; + Recurrence recurrence; String description; Expense(this.name, this.cost, this.recurrence, this.description);