Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Configuration

Dimitar Zabaznoski edited this page Jun 15, 2021 · 1 revision

Flavors

The project has 4 flavor configurations: MOCK, DEV, STAGING, PRODUCTION and 4 main entry points:

  • main_mock.dart
  • main_dev.dart
  • main_staging.dart
  • main_production.dart

Add your flavor specific constants in config/flavor_config/FlavorValues (like API base url)

To configure the project for the 1st time see the project README.

For configuring the flavors see the official documentation.

Pre-app config

Path: config/pre_app_config.dart

The pre-app configuration is called before running the flutter app. It contains actions that provide state that needs to be awaited before the app runs. When adding your own actions here make sure that they are not time-consuming because that will increase the app load time resulting in bad UX.

For less important actions that don't need to be awaited see config/post_app_config.dart

The current pre-app config executes the following actions:

  • Initializes widgets binding
  • Configures Firebase
  • Initializes loggers:
    • Console logger (except in production)
    • File logger (except in production)
    • Firebase logger
  • Sets up the service locator
  • Initializes UserManager
  • Initializes PreferencesHelper which holds your settings state

Post-app config

Path: config/post_app_config.dart

The post-app configuration is called after rendering the App widget. Here you can add anything that is alright to be executed after the app is rendered because we do not want to make the initial load time of our app longer.

For example, here we run a test platform method to check if the platform comm is working, but only if the project flavor is not production.

Clone this wiki locally