Add the enum properly.
This commit is contained in:
parent
19e10e6792
commit
b07a8f9c0a
@ -16,11 +16,11 @@ class MainApp extends StatelessWidget {
|
||||
const inputHeight = 50.0;
|
||||
|
||||
const recurrenceValues = <DropdownMenuEntry>[
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user