Skip to content

hanshsieh/freedger-mobile

Repository files navigation

Freedger

A liberating app designed to free you from the hassles of expense tracking and financial management.

NOTE This repository is still under development. It's not yet ready to use.

Developemnt

Assets

The assets directory houses images, fonts, and any other files you want to include with your application.

  • assets/images: Contains resolution-aware images.
  • assets/i18n: Contains the localization strings for the slang package.

Localization

This project generates the localization strings with slang package.
The localization strings are defined in the assets/i18n directory.
The configuration file is slang.yaml.
After updating the localization strings, run the command below to generate the code:

dart run slang

If you add a new language, run

dart run slang configure

You can utilize AI models to generate the localization strings. To do so, add the strings in the base en.i18n.json, and then run the command below:

dart run slang_gpt --api-key={openai_api_key}

See slang_gpt for the details.

Naming Convension

  • Class names
    • If the class encapsulates the logic or data of an action or command, use Verb + Noun
      • Do: CreateAccount, CreateAccountScreen, UpdateAccount, UpdateAccountScreen
      • Don't: AccountCreate, AccountCreateScreen, AccountUpdate, AccountUpdateScreen
      • The class for viewing resources is an exception. We use AccountScreen and AccountViewModel instead of ViewAccountScreen and ViewAccountViewModel.
    • If a screen class is used for both update and create, use AccountFormScreen.
    • If a domain class is used as a base class for both create and update (e.g. CreateAccountChannel and UpdateAccountChannel), use AccountChannelCommand.
    • The view model of a screen AccountScreen is named as AccountViewModel instead of AccountScreenViewModel because the view model may also be used for the child widgets. The view model is bound to the concept of Account, not AccountScreen.
  • Widget class
    • If the widget is a screen, use XXXScreen.
    • If the widget is a screen that can be used for both update and create, use XXXFormScreen.
    • If the widget is a dialog, use XXXDialog.
    • If the widget is a child widget, use a name similar to the Flutter widget name. If it's needed to disambiguate from other business classes, use suffix View, such as TransactionListView.
  • Route path
    • Use resource + action.
    • For example, /trasactions/:id/view, /transactions/:id/update, /transactions/view
    • Action is needed even if it's only for viewing a resource because otherwise /transactions/:id and /transactions/view will conflict.

Generating Models

This project uses freezed to generate models.
If you update the model classes, run the following command to generate the models:

dart run build_runner build --delete-conflicting-outputs

Or, use the command below to continuously watch for changes:

dart run build_runner watch -d

Environments

The env directory contains environment variables for different flavors.

Adding New Flavors

  1. Create a new file in the env directory with the appropriate flavor name (e.g., dev.json for development)
  2. Add environment variables following the same structure as existing files
  3. Update productFlavors in android/app/build.gradle to include the new flavor
  4. Run flutter run --flavor dev --dart-define-from-file env/dev.json to load the environment variables.

Run

For dev environment:

flutter run --flavor dev --dart-define-from-file env/dev.json

For prod environment:

flutter run --flavor prod --dart-define-from-file env/prod.json

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors