| Environment | Status |
|---|---|
| Production | - |
| Staging | - |
| Development | - |
| Hotfix | - |
| Patch | - |
| Project | URL |
|---|---|
| BE API (NestJS) | https://bitbucket.org/rd_tg/easysales-api-ind |
| FE Admin (React) | https://bitbucket.org/rd_tg/easysales-web-in |
| FE Mobile (Flutter) | https://bitbucket.org/rd_tg/easysales-mobile-ind |
| Environment | Git Branch |
|---|---|
| Production | main |
| Staging | qa |
| Development | dev |
| Hotfix | hotfix |
| Patch | patch |
- Run below command to setup flutter version
- Current version for this project is 3.41.4
- Docs : https://fvm.app/docs/getting_started/overview
# install the flutter version using fvm
fvm install 3.38.7
# select the flutter version for current project
fvm use 3.38.7
# use fvm command to proxy your flutter command
fvm flutter pub get
fvm flutter pub run build_runner build -d
- This project make use of
flutter_translation_sheetwhich enables us to make use of Google Sheet - Package: https://pub.dev/packages/flutter_translation_sheet
- Wiki: https://github.com/roipeker/flutter_translation_sheet/wiki
- Once you create the Google credentials
https://github.com/roipeker/flutter_translation_sheet/wiki/Google-credentials - Download the file and rename it to
credentials.json - Add the
credentials.jsonto the project rootpackages/common - Run
fvm dart pub global activate flutter_translation_sheet - Run:
fvm dart run flutter_translation_sheet:main runto generate the translation file - Run
fvm dart run flutter_translation_sheet:main fetchto fetch the existing translation data from Google Sheet
- Run Build Runner
bash run_build_runner.sh
- Setup .env in packages/core
1. Rename .dev.env.example to .dev.env 2. Rename .qa.env.example to .dev.env 3. Rename .prod.env.example to .dev.env 4. Add the required values to the keys
-
1. Create a 3 firebase project for development, QA/Staging, Production 2. For each Firebase Project enable Firebase Authentication Provider - Phone
- Android google-services.json
- Download the google-services.json
- Add the download file to
android/app/src/dev android/app/src/qa android/app/src/prod - Android Code Signing - Required for local build and for CI/CD use Secret and Environment Variable from provider
- Generate a Keystore file or use a existing key available in Google Drive
keytool -genkeypair -v -keystore tonggarden.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias tonggarden
- Copy
tonggarden.jkstoandroid/keystores - Create
key.propertiesatandroid/key.propertiesand set below detaildev.keyAlias=YOUR-KEY_ALIAS dev.keyPassword=YOUR-KEY-PASSWORD dev.storeFile=../keystores/tonggarden.jks / Mac-Linux For Windows dev.storeFile=D:\\KeyStore\\tonggarden.jks dev.storePassword=YOUR-STORE-PASSWORD qa.keyAlias=YOUR-KEY_ALIAS qa.keyPassword=YOUR-KEY-PASSWORD qa.storeFile=../keystores/tonggarden.jks / Mac-Linux For Windows qa.storeFile=D:\\KeyStore\\tonggarden.jks qa.storePassword=YOUR-STORE-PASSWORD prod.keyAlias=YOUR-KEY_ALIAS prod.keyPassword=YOUR-KEY-PASSWORD prod.storeFile=../keystores/tonggarden.jks / Mac-Linux For Windows prod.storeFile=D:\\KeyStore\\tonggarden.jks prod.storePassword=YOUR-STORE-PASSWORD - In your
local.propertiesatandroid/local.propertiesadd the below data at the end of the fileflutter.versionName=0.1.0 flutter.minSdkVersion=25 flutter.targetSdkVersion=34 flutter.compileSdkVersion=34
- Generate a Keystore file or use a existing key available in Google Drive
Note: If you want to publish the app to app store you need to change the package name
-
iOS GoogleService-Info.plist
- Download the GoogleService-Info.plist
- Add the download file to
ios/Runner/Dev ios/Runner/QA ios/Runner/Prod -
iOS Code Signing
- Login to your apple account and create a Certificate, Identifier, Provisioning Profile
- Identifier should include a Push Notification
- Download the Provisioning Profile and copy it to
/Users/YOUR-USER/Library/MobileDevice/Provisioning Profiles - Open the project in XCode select
Runner->TARGETS->Runner->Build Phases->Firebase Crashlyticsand replace yourGOOGLE_APP_IDfrom GoogleService-Info.plist - Configure
ios/export_options.plistto match your signing config - Only required if you are usingshorebirdto build and patch locally
-
Note: If you want to publish the app to app store you need to change the package name
- Build a Dev version
fvm flutter build apk --release --build-name=1.0.0 --build-number=1 --obfuscate --split-debug-info=build/app/symbols --flavor dev -t lib/main_dev.dart
- Build QA version
fvm flutter build appbundle --release --build-name=1.0.0 --build-number=1 --obfuscate --split-debug-info=build/app/symbols --flavor qa -t lib/main_qa.dart
- Build Prod version
fvm flutter build appbundle --release --build-name=1.0.0 --build-number=1 --obfuscate --split-debug-info=build/app/symbols --flavor prod -t lib/main_prod.dart
- Build Dev version
fvm flutter build ipa --release --export-options-plist ios/export_options_dev.plist --obfuscate --split-debug-info=build/ios/symbols --flavor dev -t lib/main_dev.dart
- Build QA version
fvm flutter build ipa --release --export-options-plist ios/export_options_qa.plist --obfuscate --split-debug-info=build/ios/symbols --build-name=1.0.0 --build-number=1 --flavor qa -t lib/main_qa.dart
- Build Prod version
fvm flutter build ipa --release --export-options-plist ios/export_options_prod.plist--obfuscate --split-debug-info=build/ios/symbols --build-name=1.0.0 --build-number=1 --flavor prod -t lib/main_prod.dart
-
Build Flavor Dev
shorebird debug ios --build-name=1.0.0 --build-number=1 --flavor dev --export-options-plist ios/export_options.plist -t lib/main_dev.dart
shorebird debug android --build-name=1.0.0 --build-number=1 --flavor dev -t lib/main_dev.dart
-
Build Flavor QA
shorebird release ios --build-name=1.0.0 --build-number=1 --flavor qa --export-options-plist ios/export_options.plist -t lib/main_qa.dart
shorebird release android --build-name=1.0.0 --build-number=1 --flavor qa -t lib/main_qa.dart
-
Build Flavor Prod
shorebird release ios --build-name=1.0.0 --build-number=1 --flavor prod --export-options-plist ios/export_options.plist -t lib/main_prod.dart
shorebird release android --build-name=1.0.0 --build-number=1 --flavor prod -t lib/main_prod.dart
-
Patch Flavor Prod - Note: without the --release-version option will patch the current version of the app.
shorebird patch --platforms=android --flavor=prod --target=lib/main_prod.dart --release-version=1.0.0+1
shorebird patch --platforms=ios --flavor=prod --target=lib/main_prod.dart --release-version=1.0.0+1
shorebird patch --platforms=android --flavor=prod --target=lib/main_prod.dart
shorebird patch --platforms=ios --flavor=prod --target=lib/main_prod.dart
- Before you start making changes to your initial database schema, run this command to generate the initial schema file.
dart run drift_dev make-migrations- Once you're happy with the changes, bump the schemaVersion in your database class and run the command again.
dart run drift_dev make-migrations- configure Git to look for the hooks in the given directory
.githooks/.
git config core.hooksPath .githooks/flutter create --template=package your-package-name-
keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
- The -w 0 flag ensures no line wrapping, which is important for proper decoding.
cat .prod.env | base64 -w 0Error: CocoaPods not installed or not in valid state.1. fvm flutter clean 2. fvm flutter pub get 3. Quit the VS Code (Not close but quit)