Test UI done enough, start working on how to get the input into an Expense.
This commit is contained in:
parent
811313dc2c
commit
19e10e6792
@ -12,7 +12,10 @@ class MainApp extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
const recurranceValues = <DropdownMenuEntry>[
|
const inputWidth = 400.0;
|
||||||
|
const inputHeight = 50.0;
|
||||||
|
|
||||||
|
const recurrenceValues = <DropdownMenuEntry>[
|
||||||
DropdownMenuEntry(value: "D", label: "Daily"),
|
DropdownMenuEntry(value: "D", label: "Daily"),
|
||||||
DropdownMenuEntry(value: "W", label: "Weekly"),
|
DropdownMenuEntry(value: "W", label: "Weekly"),
|
||||||
DropdownMenuEntry(value: "B", label: "Biweekly"),
|
DropdownMenuEntry(value: "B", label: "Biweekly"),
|
||||||
@ -20,35 +23,38 @@ class MainApp extends StatelessWidget {
|
|||||||
DropdownMenuEntry(value: "Y", label: "Yearly")
|
DropdownMenuEntry(value: "Y", label: "Yearly")
|
||||||
];
|
];
|
||||||
|
|
||||||
|
var cost;
|
||||||
|
|
||||||
return const MaterialApp(
|
return const MaterialApp(
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Column(mainAxisSize: MainAxisSize.min, spacing: 10, children: [
|
child: Column(mainAxisSize: MainAxisSize.min, spacing: 10, children: [
|
||||||
Text('Input an expense below!'),
|
Text('Input an expense below!'),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 400,
|
width: inputWidth,
|
||||||
height: 50,
|
height: inputHeight,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
keyboardType: TextInputType.text,
|
keyboardType: TextInputType.text,
|
||||||
decoration: InputDecoration(hintText: "Expense Name"),
|
decoration: InputDecoration(hintText: "Expense Name"),
|
||||||
|
// https://docs.flutter.dev/cookbook/forms/retrieve-input
|
||||||
|
|
||||||
)),
|
)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 400,
|
width: inputWidth,
|
||||||
height: 50,
|
height: inputHeight,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
keyboardType: TextInputType.numberWithOptions(decimal: true),
|
keyboardType: TextInputType.numberWithOptions(decimal: true),
|
||||||
decoration: InputDecoration(hintText: "Expense Cost"),
|
decoration: InputDecoration(hintText: "Expense Cost"),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
dropdownMenuEntries: recurranceValues,
|
dropdownMenuEntries: recurrenceValues,
|
||||||
hintText: "Recurrance",
|
hintText: "Recurrence",
|
||||||
width: 400,
|
width: inputWidth,
|
||||||
menuHeight: 50,
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 400,
|
width: inputWidth,
|
||||||
height: 50,
|
height: inputHeight,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
keyboardType: TextInputType.text,
|
keyboardType: TextInputType.text,
|
||||||
decoration: InputDecoration(hintText: "Expense Description"),
|
decoration: InputDecoration(hintText: "Expense Description"),
|
||||||
@ -59,3 +65,12 @@ class MainApp extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Expense {
|
||||||
|
String name;
|
||||||
|
double cost;
|
||||||
|
Enum recurrence;
|
||||||
|
String description;
|
||||||
|
|
||||||
|
Expense(this.name, this.cost, this.recurrence, this.description);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user