Code
Cashew – Personal finances on Flutter

Cashew is a full-fledged, feature-rich application designed to empower users in managing their finances effectively. Built using Flutter – with Drift’s SQL package, and Firebase – this app offers a seamless and intuitive user experience across various devices. Development started in September 2021.
Developer Notes
Android Release
- To build an app-bundle Android release, run
flutter build appbundle --release
.
Note: required Android SDK.
iOS Release
- To build an IPA iOS release, run
flutter build ipa
.
Note: requires MacOS.
Firebase Deployment
- To deploy to firebase, run
firebase deploy
Note: required Firebase.
GitHub release
- Create a tag for the current version specified in
pubspec.yaml
git tag <version>
- Push the tag
git push origin <version>
- Create the release and upload binaries
- https://github.com/jameskokoska/Cashew/releases/new
Scripts
deploy_and_build_windows.bat
- Deploy to Firebase and build the apk and appbundle
open_release_builds.bat
- Opens the location of the built apk and appbundle
update_translations.bat
- Downloads the latest version of Cashew translations. Runs
budget\assets\translations\generate-translations.py
Develop Wirelessly on Android
adb tcpip 5555
adb connect <IP>
- Get the phone’s IP by going to
About Phone
>Status Information
>IP Address
Migrate Database
- Make any database changes to the schema and tables
- Bump the schema version
- Change
int schemaVersionGlobal = ...+1
intables.dart
- Change
- Make sure you are in application root directory
cd .\budget\
- Generate database code
- Run
dart run build_runner build
- Run
- Export the new schema
- Generate schema dump for the newly created schema
- Replace
[schemaVersion]
in the command below with the value ofschemaVersionGlobal
- Run
dart run drift_dev schema dump lib\database\tables.dart drift_schemas//drift_schema_v[schemaVersion].json
- Read more: https://drift.simonbinder.eu/docs/advanced-features/migrations/#exporting-the-schema
- Generate step-by-step migrations
- Run
dart run drift_dev schema steps drift_schemas/ lib\database\schema_versions.dart
- Run
- Implement migration strategy
- Edit
await stepByStep(...)
function intables.dart
and add the migration strategy for the new version migration
- Edit
Get Platform
- Use
getPlatform()
fromfunctions.dart
- Since
Platform
is not supported on web, we must create a wrapper and always use this to determine the current platform
Push Route
- If we want to navigate to a new page, stick to
pushRoute(context, page)
function fromfunctions.dart
- It handles the platform routing and
PageRouteBuilder
Wallets vs. Accounts
Wallets
have been been renamed toAccounts
on the front-end but internally, the nameWallet
is still used.
Objectives vs. Goals
Objectives
have been been renamed toGoals
on the front-end but internally, the nameObjectives
is still used.
