Skip to content

WebTrit/webtrit_phone

Repository files navigation

webtrit_phone

WebTrit Phone application.

Variables

Dart define

  • WEBTRIT_APP_ID_SUFFIX - suffix added to applicationId (with value com.webtrit.app) on Android and to CFBundleIdentifier (with value com.webtrit.app) on iOS (default is empty)
  • WEBTRIT_APP_LINK_DOMAIN - domain used to set up Android app links and iOS universal links (to generate the required .well-known files, use the assetlinks-generate command from webtrit_phone_tools
  • WEBTRIT_APP_NAME (default WebTrit)
  • WEBTRIT_APP_DESCRIPTION (default is empty)
  • WEBTRIT_APP_CORE_URL (optional)
  • WEBTRIT_APP_DEMO_CORE_URL (default http://localhost:4000)
  • WEBTRIT_APP_PERIODIC_POLLING (default true)
  • WEBTRIT_APP_DEBUG_LEVEL (default INFO)
  • WEBTRIT_APP_DATABASE_LOG_STATEMENTS (default false)

Default build variables located in dart_define.json and could be add to flutter run or build with --dart-define-from-file=dart_define.json parameter.

Environment

  • WEBTRIT_ANDROID_RELEASE_UPLOAD_KEYSTORE_PATH - path to folder structure created by keystore-generate command of webtrit_phone_tools (KeystoreGenerator)

SSL Certificates

To use SSL certificates, you need to:

  1. add the following files to the assets/certificates folder
  2. for PKCS12 add passwords to the assets/certificates/credentials.json where the key is the file name and the value is the password
  3. run flutter_gen or buid_runner to generate the necessary code

Build

Android

Command line example:

WEBTRIT_ANDROID_RELEASE_UPLOAD_KEYSTORE_PATH=<path for KeystoreGenerator created folder structure> && \
flutter build appbundle --dart-define-from-file=dart_define.json

iOS

Command line example:

flutter build ipa --dart-define-from-file=dart_define.json

Web

Command line example:

flutter build web --dart-define-from-file=dart_define.json
  
dart run tool/extenvsubst.dart dart_define.json build/web/index.html

Renaming

To rename the default fields for each platform project within the WebTrit Phone application, the package_rename package can be used.

Localizely

Preparation

Workflow

Follow these steps according to your specific activity to manage the localization of your application efficiently.

Developing

  1. Add, update, or remove the necessary key(s) in lib/l10n/arb/app_en.arb.
  2. Push the key(s) to Localizely using the command: localizely-cli push.
  3. If necessary, translate the key(s) on the Localizely platform, ensuring to remove helper tags from the key(s).
  4. Pull the key(s) from Localizely using the command: localizely-cli pull.
  5. Generate the localizations with the command: flutter gen-l10n.
  6. Commit the changes.

Refinement

  1. Pull the key(s) from Localizely using the command: localizely-cli pull.
  2. Generate the localizations with the command: flutter gen-l10n.
  3. Commit the changes.

Adding a New Locale

  1. Add the new locale to the download files list in localizely.yml.
  2. Insert locale_<locale code> in lib/l10n/arb/app_en.arb.
  3. Push the newly added key to Localizely using the command: localizely-cli push.
  4. Translate the added key on the Localizely platform, remembering to remove helper tags from the key(s).
  5. Pull the newly added key from Localizely using the command: localizely-cli pull.
  6. Generate the localizations with the command: flutter gen-l10n.
  7. Commit the changes.

Theme Configuration

For the theme configuration documentation, please refer to the Theme Configuration .

Make commands

  • run - Run the Flutter application

    make run
  • build - Build the Flutter application

    make build
  • configure - Configure application resources

    make configure id=<application_id>
  • configure-demo - Create demo configuration

    make configure-demo id=<application_id>
  • configure-classic - Create demo configuration

    make configure-classic id=<application_id>
  • build-ios - Create iOS build

    make build-ios
  • build-apk - Create APK build

    make build-apk
  • build-appbundle - Create App Bundle build

    make build-appbundle
  • clean-git - Clean git files

    make clean-git

Contributing

Contributions are always welcome!

License

MIT LICENSE

Acknowledgments

This project is tested with BrowserStack.