Test UI done enough, start working on how to get the input into an Expense.
This commit is contained in:
		@@ -12,7 +12,10 @@ class MainApp extends StatelessWidget {
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  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: "W", label: "Weekly"),
 | 
			
		||||
      DropdownMenuEntry(value: "B", label: "Biweekly"),
 | 
			
		||||
@@ -20,35 +23,38 @@ class MainApp extends StatelessWidget {
 | 
			
		||||
      DropdownMenuEntry(value: "Y", label: "Yearly")
 | 
			
		||||
    ];
 | 
			
		||||
 | 
			
		||||
    var cost;
 | 
			
		||||
 | 
			
		||||
    return const MaterialApp(
 | 
			
		||||
      home: Scaffold(
 | 
			
		||||
        body: Center(
 | 
			
		||||
          child: Column(mainAxisSize: MainAxisSize.min, spacing: 10, children: [
 | 
			
		||||
            Text('Input an expense below!'),
 | 
			
		||||
            SizedBox(
 | 
			
		||||
                width: 400,
 | 
			
		||||
                height: 50,
 | 
			
		||||
                width: inputWidth,
 | 
			
		||||
                height: inputHeight,
 | 
			
		||||
                child: TextField(
 | 
			
		||||
                  keyboardType: TextInputType.text,
 | 
			
		||||
                  decoration: InputDecoration(hintText: "Expense Name"),
 | 
			
		||||
                  // https://docs.flutter.dev/cookbook/forms/retrieve-input
 | 
			
		||||
 | 
			
		||||
                )),
 | 
			
		||||
            SizedBox(
 | 
			
		||||
              width: 400,
 | 
			
		||||
              height: 50,
 | 
			
		||||
              width: inputWidth,
 | 
			
		||||
              height: inputHeight,
 | 
			
		||||
              child: TextField(
 | 
			
		||||
                keyboardType: TextInputType.numberWithOptions(decimal: true),
 | 
			
		||||
                decoration: InputDecoration(hintText: "Expense Cost"),
 | 
			
		||||
              ),
 | 
			
		||||
            ),
 | 
			
		||||
            DropdownMenu(
 | 
			
		||||
              dropdownMenuEntries: recurranceValues,
 | 
			
		||||
              hintText: "Recurrance",
 | 
			
		||||
              width: 400,
 | 
			
		||||
              menuHeight: 50,
 | 
			
		||||
              dropdownMenuEntries: recurrenceValues,
 | 
			
		||||
              hintText: "Recurrence",
 | 
			
		||||
              width: inputWidth,
 | 
			
		||||
            ),
 | 
			
		||||
            SizedBox(
 | 
			
		||||
                width: 400,
 | 
			
		||||
                height: 50,
 | 
			
		||||
                width: inputWidth,
 | 
			
		||||
                height: inputHeight,
 | 
			
		||||
                child: TextField(
 | 
			
		||||
                  keyboardType: TextInputType.text,
 | 
			
		||||
                  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);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user