Refactor the order of the classes based on the UI.
This commit is contained in:
parent
c2cc71eae0
commit
43dd151cb4
119
lib/main.dart
119
lib/main.dart
@ -7,6 +7,18 @@ void main() {
|
|||||||
runApp(const MainApp());
|
runApp(const MainApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://www.tutorialspoint.com/dart_programming/dart_programming_enumeration.htm
|
||||||
|
enum Recurrence { daily, weekly, biweekly, montly, yearly }
|
||||||
|
|
||||||
|
class Expense {
|
||||||
|
String name;
|
||||||
|
double cost;
|
||||||
|
Recurrence recurrence;
|
||||||
|
String description;
|
||||||
|
|
||||||
|
Expense(this.name, this.cost, this.recurrence, this.description);
|
||||||
|
}
|
||||||
|
|
||||||
class MainApp extends StatelessWidget {
|
class MainApp extends StatelessWidget {
|
||||||
const MainApp({super.key});
|
const MainApp({super.key});
|
||||||
|
|
||||||
@ -104,39 +116,6 @@ class _HomePageState extends State<HomePage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SettingsPage extends StatelessWidget {
|
|
||||||
const SettingsPage({
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Placeholder();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ProjectionPage extends StatelessWidget {
|
|
||||||
const ProjectionPage({
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Placeholder();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class AssetPage extends StatelessWidget {
|
|
||||||
const AssetPage({
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Placeholder();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ExpensePage extends StatelessWidget {
|
class ExpensePage extends StatelessWidget {
|
||||||
const ExpensePage({
|
const ExpensePage({
|
||||||
super.key,
|
super.key,
|
||||||
@ -148,22 +127,6 @@ class ExpensePage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class IncomePage extends StatelessWidget {
|
|
||||||
const IncomePage({
|
|
||||||
super.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Center(child: Column(
|
|
||||||
children: [
|
|
||||||
Text("TBD"),
|
|
||||||
Placeholder(),
|
|
||||||
],
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ExpenseInputForm extends StatefulWidget {
|
class ExpenseInputForm extends StatefulWidget {
|
||||||
const ExpenseInputForm({
|
const ExpenseInputForm({
|
||||||
super.key,
|
super.key,
|
||||||
@ -189,7 +152,7 @@ class _ExpenseInputFormState extends State<ExpenseInputForm> {
|
|||||||
|
|
||||||
return Center(
|
return Center(
|
||||||
child: Column(mainAxisSize: MainAxisSize.min, spacing: 10, children: [
|
child: Column(mainAxisSize: MainAxisSize.min, spacing: 10, children: [
|
||||||
Text('Input an expense below!'),
|
Text('New Expense'),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: inputWidth,
|
width: inputWidth,
|
||||||
height: inputHeight,
|
height: inputHeight,
|
||||||
@ -231,14 +194,52 @@ class _ExpenseInputFormState extends State<ExpenseInputForm> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.tutorialspoint.com/dart_programming/dart_programming_enumeration.htm
|
class IncomePage extends StatelessWidget {
|
||||||
enum Recurrence { daily, weekly, biweekly, montly, yearly }
|
const IncomePage({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
class Expense {
|
@override
|
||||||
String name;
|
Widget build(BuildContext context) {
|
||||||
double cost;
|
return Center(
|
||||||
Recurrence recurrence;
|
child: Column(
|
||||||
String description;
|
children: [
|
||||||
|
Text("TBD"),
|
||||||
Expense(this.name, this.cost, this.recurrence, this.description);
|
Placeholder(),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AssetPage extends StatelessWidget {
|
||||||
|
const AssetPage({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Placeholder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ProjectionPage extends StatelessWidget {
|
||||||
|
const ProjectionPage({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Placeholder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SettingsPage extends StatelessWidget {
|
||||||
|
const SettingsPage({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Placeholder();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user