26 Commits

Author SHA1 Message Date
87392cc73c Break code into multiple files. 2025-02-05 13:33:07 -07:00
1b95feb5d4 Forms is working, items show if hot reloaded, need to refactor code and get the global variable into the state of the expense page. 2025-02-05 13:20:04 -07:00
99b1ec82e6 Add the Form widget and get the fields working with it. Still need to pull the values into a usable object for saving. 2025-02-05 04:20:10 -07:00
7ead0e5ebb Format dialog a little better. 2025-02-05 03:39:12 -07:00
bcae40e0e2 Buttons now close the dialog properly. 2025-02-05 03:27:11 -07:00
aa3c2f9304 Expense input form is now in a popup! Still needs to look and function properly though. 2025-02-05 03:20:29 -07:00
96811f5bfd Make the name of the function more agnostic. 2025-02-01 16:51:12 -07:00
c44d4553c3 Attempting to move the input form to a popup. 2025-02-01 16:50:37 -07:00
d722172cb3 Add buttons and fake items. 2025-02-01 04:17:56 -07:00
43dd151cb4 Refactor the order of the classes based on the UI. 2025-02-01 03:54:53 -07:00
c2cc71eae0 Add widgets for each of the future pages. 2025-02-01 03:48:26 -07:00
0c9b365f7f Added navigation. Very nice!! ;D 2025-02-01 03:42:14 -07:00
f820265dba Found the correct place to set the title info on Linux. 2025-02-01 03:21:12 -07:00
85b7a0a3e6 Add reminder script for how to run with no Internet connection. 2025-02-01 03:20:44 -07:00
861e8bf904 Change project name and ID. 2025-02-01 03:15:01 -07:00
aaa95bd3a6 Break the form into its own widget, since eventually it'll likely be a pop-up. 2025-02-01 03:14:34 -07:00
45b5e33491 Add license. 2025-01-30 21:06:25 -07:00
8a2dfc2131 More messing around. 2025-01-30 20:56:01 -07:00
3b7313ca10 Made the UI fancier but still unable to get the controller to work. 2025-01-30 20:48:30 -07:00
b07a8f9c0a Add the enum properly. 2025-01-30 20:32:04 -07:00
19e10e6792 Test UI done enough, start working on how to get the input into an Expense. 2025-01-30 20:27:03 -07:00
811313dc2c Actually starting to look pretty good!? 2025-01-30 20:08:34 -07:00
26f688cfe9 Random files, maybe due to flutter run. 2025-01-30 20:01:05 -07:00
a4ad5823aa A lot of messing around until something actually finally sorta worked! 2025-01-30 20:00:46 -07:00
b227ddc849 Take the main file from an empty project. (flutter create -e). 2025-01-30 19:23:12 -07:00
92ebe3c4e0 Remove extra sentence. 2025-01-30 19:22:31 -07:00
30 changed files with 456 additions and 278 deletions

9
LICENSE Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2025 me
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -4,5 +4,3 @@ Recurring expense tracker app for Android.
Add a debit as daily, weekly, monthly, etc, then see how it affects your liquid Add a debit as daily, weekly, monthly, etc, then see how it affects your liquid
assets based on your reported income over different time projections. assets based on your reported income over different time projections.
Useful for many applications!

View File

@ -1,28 +1 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

View File

@ -6,7 +6,7 @@ plugins {
} }
android { android {
namespace = "com.example.flutter_expense_tracker" namespace = "com.hyperling.expense_tracker"
compileSdk = flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion ndkVersion = flutter.ndkVersion
@ -21,7 +21,7 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.flutter_expense_tracker" applicationId = "com.hyperling.expense_tracker"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config. // For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion minSdk = flutter.minSdkVersion

View File

@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application <application
android:label="flutter_expense_tracker" android:label="Recurring Expense Tracker"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<activity <activity

View File

@ -1,4 +1,4 @@
package com.example.flutter_expense_tracker package com.example.flutter_empty
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity

View File

@ -368,7 +368,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterExpenseTracker; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEmpty;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@ -384,7 +384,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterExpenseTracker.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEmpty.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -401,7 +401,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterExpenseTracker.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEmpty.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@ -416,7 +416,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterExpenseTracker.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEmpty.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@ -547,7 +547,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterExpenseTracker; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEmpty;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -569,7 +569,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterExpenseTracker; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEmpty;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;

View File

@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Flutter Expense Tracker</string> <string>Flutter Empty</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
@ -13,7 +13,7 @@
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>flutter_expense_tracker</string> <string>flutter_empty</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>

View File

@ -1,125 +1,130 @@
// Helpful guides:
// - https://flutter.dev/docs/cookbook/forms/validation
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '/pages/expense.dart';
import '/pages/income.dart';
import '/pages/asset.dart';
import '/pages/report.dart';
import '/pages/settings.dart';
void main() { void main() {
runApp(const MyApp()); runApp(const MainApp());
} }
class MyApp extends StatelessWidget { class MainApp extends StatelessWidget {
const MyApp({super.key}); const MainApp({super.key});
// This widget is the root of your application.
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
title: 'Flutter Demo', title: 'Recurring Expense Tracker',
theme: ThemeData( theme: ThemeData(
// This is the theme of your application.
//
// TRY THIS: Try running your application with "flutter run". You'll see
// the application has a purple toolbar. Then, without quitting the app,
// try changing the seedColor in the colorScheme below to Colors.green
// and then invoke "hot reload" (save your changes or press the "hot
// reload" button in a Flutter-supported IDE, or press "r" if you used
// the command line to start the app).
//
// Notice that the counter didn't reset back to zero; the application
// state is not lost during the reload. To reset the state, use hot
// restart instead.
//
// This works for code too, not just values: Most code changes can be
// tested with just a hot reload.
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true, useMaterial3: true,
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
), ),
home: const MyHomePage(title: 'Flutter Demo Home Page'), home: HomePage(),
); );
} }
} }
class MyHomePage extends StatefulWidget { class HomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title}); const HomePage({
super.key,
// This widget is the home page of your application. It is stateful, meaning });
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override @override
State<MyHomePage> createState() => _MyHomePageState(); State<HomePage> createState() => _HomePageState();
} }
class _MyHomePageState extends State<MyHomePage> { class _HomePageState extends State<HomePage> {
int _counter = 0; var pageSelected = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done Widget page;
// by the _incrementCounter method above. Widget? dialog;
// switch (pageSelected) {
// The Flutter framework has been optimized to make rerunning build methods case 0:
// fast, so that you can just rebuild anything that needs updating rather page = ExpensePage();
// than having to individually change instances of widgets. dialog = ExpenseInputDialog();
return Scaffold( case 1:
appBar: AppBar( page = IncomePage();
// TRY THIS: Try changing the color here to a specific color (to case 2:
// Colors.amber, perhaps?) and trigger a hot reload to see the AppBar page = AssetPage();
// change color while the other colors stay the same. case 3:
backgroundColor: Theme.of(context).colorScheme.inversePrimary, page = ProjectionPage();
// Here we take the value from the MyHomePage object that was created by case 4:
// the App.build method, and use it to set our appbar title. page = SettingsPage();
title: Text(widget.title), default:
), throw UnimplementedError('No widget for page $pageSelected yet!');
body: Center( }
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent. Future<void> addNewValue(BuildContext context) {
child: Column( return showDialog(
// Column is also a layout widget. It takes a list of children and context: context, builder: (_) => AlertDialog(content: dialog));
// arranges them vertically. By default, it sizes itself to fit its }
// children horizontally, and tries to be as tall as its parent.
// Widget? floatingButton;
// Column has various properties to control how it sizes itself and if (dialog != null) {
// how it positions its children. Here we use mainAxisAlignment to floatingButton = IconButton(
// center the children vertically; the main axis here is the vertical onPressed: () {
// axis because Columns are vertical (the cross axis would be addNewValue(context);
// horizontal). },
// icon: Icon(Icons.add),
// TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" color: Theme.of(context).colorScheme.onSurface,
// action in the IDE, or press "p" in the console), to see the );
// wireframe for each widget. }
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ return LayoutBuilder(builder: (context, constraints) {
const Text( return Scaffold(
'You have pushed the button this many times:', // TODO: Add a drawer instead of nav rail.
body: Row(
children: [
SafeArea(
child: NavigationRail(
extended: constraints.maxWidth >= 800,
destinations: [
NavigationRailDestination(
icon: Icon(Icons.payment),
label: Text('Expenses'),
),
NavigationRailDestination(
icon: Icon(Icons.account_balance),
label: Text('Income'),
),
NavigationRailDestination(
icon: Icon(Icons.attach_money),
label: Text('Liquid Assets'),
),
NavigationRailDestination(
icon: Icon(Icons.bar_chart),
label: Text('Projections'),
),
NavigationRailDestination(
icon: Icon(Icons.settings),
label: Text('Settings'),
),
],
selectedIndex: pageSelected,
onDestinationSelected: (value) {
setState(() {
pageSelected = value;
});
},
),
), ),
Text( Expanded(
'$_counter', child: Container(
style: Theme.of(context).textTheme.headlineMedium, color: Theme.of(context).colorScheme.primaryContainer,
child: page,
),
), ),
], ],
), ),
), floatingActionButton: floatingButton,
floatingActionButton: FloatingActionButton( );
onPressed: _incrementCounter, });
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
} }
} }

18
lib/models/expense.dart Normal file
View File

@ -0,0 +1,18 @@
import '/models/frequency.dart';
class Expense {
final String name;
final double cost;
final Frequency frequency;
final String description;
const Expense(
{required this.name,
required this.cost,
required this.frequency,
required this.description});
String toString() {
return "$name, $cost, ${frequency.title}, $description";
}
}

12
lib/models/frequency.dart Normal file
View File

@ -0,0 +1,12 @@
// https://www.tutorialspoint.com/dart_programming/dart_programming_enumeration.htm
enum Frequency {
daily(title: "Daily"),
weekly(title: "Weekly"),
biweekly(title: "Biweekly"),
montly(title: "Monthly"),
yearly(title: "Yearly");
const Frequency({required this.title});
final String title;
}

12
lib/pages/asset.dart Normal file
View File

@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
class AssetPage extends StatelessWidget {
const AssetPage({
super.key,
});
@override
Widget build(BuildContext context) {
return Placeholder();
}
}

214
lib/pages/expense.dart Normal file
View File

@ -0,0 +1,214 @@
import 'package:flutter/material.dart';
import '/models/expense.dart';
import '/models/frequency.dart';
List<Expense> expenses = [];
class ExpensePage extends StatelessWidget {
const ExpensePage({
super.key,
});
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: expenses.length,
itemBuilder: (_, index) {
final Expense curr = expenses[index];
return Center(
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.greenAccent,
),
child: Column(
children: [
Text(curr.name),
Text("${curr.cost.toString()} ${curr.frequency.title}"),
],
),
),
),
);
});
/*
return ListView(
children: [
ListTile(
title: Text("Fake Item 1"),
subtitle: Text("30.00 / month"),
),
ListTile(
title: Text("Fake Item 2"),
subtitle: Text("180.00 / year"),
),
],
);
*/
}
}
class ExpenseInputDialog extends StatefulWidget {
const ExpenseInputDialog({
super.key,
});
@override
State<ExpenseInputDialog> createState() => _ExpenseInputDialogState();
}
class _ExpenseInputDialogState extends State<ExpenseInputDialog> {
final _expenseFormKey = GlobalKey<FormState>();
String _name = "";
double _cost = 0.0;
Frequency _freq = Frequency.montly;
String _desc = "";
@override
Widget build(BuildContext context) {
const inputWidth = 300.0;
const inputHeight = 50.0;
List<DropdownMenuItem> freqValues = [];
for (var freq in Frequency.values) {
freqValues.add(DropdownMenuItem(value: freq, child: Text(freq.title)));
}
;
return AlertDialog(
title: Center(child: Text("Add New Expense")),
content: Form(
key: _expenseFormKey,
autovalidateMode: AutovalidateMode.onUserInteraction,
child: Column(mainAxisSize: MainAxisSize.min, spacing: 10, children: [
SizedBox(
width: inputWidth,
height: inputHeight,
child: TextFormField(
keyboardType: TextInputType.text,
decoration: InputDecoration(
labelText: "Name",
hintText: "Example: Red Pocket Phone Bill",
),
validator: (value) {
if (value!.isEmpty) {
return "Name must be provided.";
}
return null;
},
onSaved: (newValue) {
_name = newValue!;
},
),
),
SizedBox(
width: inputWidth,
height: inputHeight,
child: TextFormField(
keyboardType: TextInputType.numberWithOptions(decimal: true),
decoration: InputDecoration(
labelText: "Cost", hintText: "Example: 10.00"),
validator: (value) {
if (value!.isEmpty) {
return "Cost must be provided.";
}
if (double.tryParse(value) == null) {
return "Cost must be a valid number.";
}
return null;
},
onSaved: (newValue) {
_cost = double.parse(newValue!);
},
),
),
SizedBox(
width: inputWidth,
height: inputHeight,
child: DropdownButtonFormField(
items: freqValues,
decoration: InputDecoration(
labelText: "Recurrence", hintText: "Example: Monthly"),
validator: (value) {
if (value == null) {
return "Frequency must be provided.";
}
if (!Frequency.values.contains(value)) {
return "Value not valid.";
}
return null;
},
onChanged: (newValue) {
_freq = newValue;
},
),
),
SizedBox(
width: inputWidth,
height: inputHeight,
child: TextFormField(
keyboardType: TextInputType.text,
decoration: InputDecoration(
labelText: "Description",
hintText: "Example: 1GB data with unlimited talk & text."),
validator: (value) {
return null;
},
onSaved: (newValue) {
_desc = newValue!;
},
),
),
]),
),
actions: [
SizedBox(
width: inputWidth,
height: inputHeight,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ElevatedButton.icon(
onPressed: () {
print("TODO: Clear fields!");
Navigator.of(context).pop();
},
icon: Icon(Icons.cancel),
label: Text('Cancel'),
),
ElevatedButton.icon(
onPressed: () {
print("TODO: Save expense!");
if (_expenseFormKey.currentState!.validate()) {
_expenseFormKey.currentState!.save();
setState(() {
expenses.add(
Expense(
name: _name,
cost: _cost,
frequency: _freq,
description: _desc),
);
});
print(expenses.toString());
for (var expense in expenses) {
print(expense.toString());
}
Navigator.of(context).pop();
}
},
icon: Icon(Icons.save),
label: Text('Submit'),
),
],
),
)
],
);
}
}

18
lib/pages/income.dart Normal file
View File

@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
class IncomePage extends StatelessWidget {
const IncomePage({
super.key,
});
@override
Widget build(BuildContext context) {
return Center(
child: Column(
children: [
Text("TBD"),
Placeholder(),
],
));
}
}

12
lib/pages/report.dart Normal file
View File

@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
class ProjectionPage extends StatelessWidget {
const ProjectionPage({
super.key,
});
@override
Widget build(BuildContext context) {
return Placeholder();
}
}

12
lib/pages/settings.dart Normal file
View File

@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
class SettingsPage extends StatelessWidget {
const SettingsPage({
super.key,
});
@override
Widget build(BuildContext context) {
return Placeholder();
}
}

View File

@ -4,10 +4,10 @@ project(runner LANGUAGES CXX)
# The name of the executable created for the application. Change this to change # The name of the executable created for the application. Change this to change
# the on-disk name of your application. # the on-disk name of your application.
set(BINARY_NAME "flutter_expense_tracker") set(BINARY_NAME "expense_tracker")
# The unique GTK application identifier for this application. See: # The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID # https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "com.example.flutter_expense_tracker") set(APPLICATION_ID "com.hyperling.expense_tracker")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.

View File

@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) {
if (use_header_bar) { if (use_header_bar) {
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar)); gtk_widget_show(GTK_WIDGET(header_bar));
gtk_header_bar_set_title(header_bar, "flutter_expense_tracker"); gtk_header_bar_set_title(header_bar, "Recurring Expense Tracker");
gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_header_bar_set_show_close_button(header_bar, TRUE);
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
} else { } else {
gtk_window_set_title(window, "flutter_expense_tracker"); gtk_window_set_title(window, "Recurring Expense Tracker");
} }
gtk_window_set_default_size(window, 1280, 720); gtk_window_set_default_size(window, 1280, 720);

View File

@ -64,7 +64,7 @@
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; }; 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* flutter_expense_tracker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flutter_expense_tracker.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10ED2044A3C60003C045 /* flutter_empty.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flutter_empty.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@ -131,7 +131,7 @@
33CC10EE2044A3C60003C045 /* Products */ = { 33CC10EE2044A3C60003C045 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
33CC10ED2044A3C60003C045 /* flutter_expense_tracker.app */, 33CC10ED2044A3C60003C045 /* flutter_empty.app */,
331C80D5294CF71000263BE5 /* RunnerTests.xctest */, 331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
); );
name = Products; name = Products;
@ -217,7 +217,7 @@
); );
name = Runner; name = Runner;
productName = Runner; productName = Runner;
productReference = 33CC10ED2044A3C60003C045 /* flutter_expense_tracker.app */; productReference = 33CC10ED2044A3C60003C045 /* flutter_empty.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
@ -385,10 +385,10 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterExpenseTracker.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEmpty.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_expense_tracker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_expense_tracker"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_empty.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_empty";
}; };
name = Debug; name = Debug;
}; };
@ -399,10 +399,10 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterExpenseTracker.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEmpty.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_expense_tracker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_expense_tracker"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_empty.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_empty";
}; };
name = Release; name = Release;
}; };
@ -413,10 +413,10 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterExpenseTracker.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEmpty.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_expense_tracker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_expense_tracker"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_empty.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_empty";
}; };
name = Profile; name = Profile;
}; };

View File

@ -15,7 +15,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045" BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flutter_expense_tracker.app" BuildableName = "flutter_empty.app"
BlueprintName = "Runner" BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
@ -31,7 +31,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045" BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flutter_expense_tracker.app" BuildableName = "flutter_empty.app"
BlueprintName = "Runner" BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
@ -65,7 +65,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045" BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flutter_expense_tracker.app" BuildableName = "flutter_empty.app"
BlueprintName = "Runner" BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
@ -82,7 +82,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045" BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flutter_expense_tracker.app" BuildableName = "flutter_empty.app"
BlueprintName = "Runner" BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>

View File

@ -5,10 +5,10 @@
// 'flutter create' template. // 'flutter create' template.
// The application's name. By default this is also the title of the Flutter window. // The application's name. By default this is also the title of the Flutter window.
PRODUCT_NAME = flutter_expense_tracker PRODUCT_NAME = flutter_empty
// The application's bundle identifier // The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterExpenseTracker PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterEmpty
// The copyright displayed in application information // The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved. PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved.

View File

@ -41,14 +41,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.19.0" version: "1.19.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
url: "https://pub.dev"
source: hosted
version: "1.0.8"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:

View File

@ -1,89 +1,19 @@
name: flutter_expense_tracker name: flutter_expense_tracker
description: "A new Flutter project." description: Track recurring expenses against income and liquid assets.
# The following line prevents the package from being accidentally published to publish_to: 'none'
# pub.dev using `flutter pub publish`. This is preferred for private packages. version: 0.1.0
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1
environment: environment:
sdk: ^3.6.1 sdk: ^3.6.1
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^5.0.0 flutter_lints: ^5.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
flutter: flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/to/asset-from-package
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/to/font-from-package

3
run_offline.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
flutter run --no-pub

View File

@ -1,30 +0,0 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_expense_tracker/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}

View File

@ -23,13 +23,13 @@
<!-- iOS meta tags & icons --> <!-- iOS meta tags & icons -->
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="flutter_expense_tracker"> <meta name="apple-mobile-web-app-title" content="flutter_empty">
<link rel="apple-touch-icon" href="icons/Icon-192.png"> <link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/> <link rel="icon" type="image/png" href="favicon.png"/>
<title>flutter_expense_tracker</title> <title>flutter_empty</title>
<link rel="manifest" href="manifest.json"> <link rel="manifest" href="manifest.json">
</head> </head>
<body> <body>

View File

@ -1,6 +1,6 @@
{ {
"name": "flutter_expense_tracker", "name": "flutter_empty",
"short_name": "flutter_expense_tracker", "short_name": "flutter_empty",
"start_url": ".", "start_url": ".",
"display": "standalone", "display": "standalone",
"background_color": "#0175C2", "background_color": "#0175C2",

View File

@ -1,10 +1,10 @@
# Project-level configuration. # Project-level configuration.
cmake_minimum_required(VERSION 3.14) cmake_minimum_required(VERSION 3.14)
project(flutter_expense_tracker LANGUAGES CXX) project(flutter_empty LANGUAGES CXX)
# The name of the executable created for the application. Change this to change # The name of the executable created for the application. Change this to change
# the on-disk name of your application. # the on-disk name of your application.
set(BINARY_NAME "flutter_expense_tracker") set(BINARY_NAME "flutter_empty")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.

View File

@ -90,12 +90,12 @@ BEGIN
BLOCK "040904e4" BLOCK "040904e4"
BEGIN BEGIN
VALUE "CompanyName", "com.example" "\0" VALUE "CompanyName", "com.example" "\0"
VALUE "FileDescription", "flutter_expense_tracker" "\0" VALUE "FileDescription", "flutter_empty" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "flutter_expense_tracker" "\0" VALUE "InternalName", "flutter_empty" "\0"
VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0" VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0"
VALUE "OriginalFilename", "flutter_expense_tracker.exe" "\0" VALUE "OriginalFilename", "flutter_empty.exe" "\0"
VALUE "ProductName", "flutter_expense_tracker" "\0" VALUE "ProductName", "flutter_empty" "\0"
VALUE "ProductVersion", VERSION_AS_STRING "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0"
END END
END END

View File

@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
FlutterWindow window(project); FlutterWindow window(project);
Win32Window::Point origin(10, 10); Win32Window::Point origin(10, 10);
Win32Window::Size size(1280, 720); Win32Window::Size size(1280, 720);
if (!window.Create(L"flutter_expense_tracker", origin, size)) { if (!window.Create(L"flutter_empty", origin, size)) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
window.SetQuitOnClose(true); window.SetQuitOnClose(true);