62 lines
1.8 KiB
Dart
62 lines
1.8 KiB
Dart
// Helpful guides:
|
|
// - https://flutter.dev/docs/cookbook/forms/validation
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
void main() {
|
|
runApp(const MainApp());
|
|
}
|
|
|
|
class MainApp extends StatelessWidget {
|
|
const MainApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
const recurranceValues = <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")
|
|
];
|
|
|
|
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,
|
|
child: TextField(
|
|
keyboardType: TextInputType.text,
|
|
decoration: InputDecoration(hintText: "Expense Name"),
|
|
)),
|
|
SizedBox(
|
|
width: 400,
|
|
height: 50,
|
|
child: TextField(
|
|
keyboardType: TextInputType.numberWithOptions(decimal: true),
|
|
decoration: InputDecoration(hintText: "Expense Cost"),
|
|
),
|
|
),
|
|
DropdownMenu(
|
|
dropdownMenuEntries: recurranceValues,
|
|
hintText: "Recurrance",
|
|
width: 400,
|
|
menuHeight: 50,
|
|
),
|
|
SizedBox(
|
|
width: 400,
|
|
height: 50,
|
|
child: TextField(
|
|
keyboardType: TextInputType.text,
|
|
decoration: InputDecoration(hintText: "Expense Description"),
|
|
)),
|
|
]),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|