diff --git a/README.md b/README.md index 93f6c8a..1693f22 100644 --- a/README.md +++ b/README.md @@ -142,11 +142,15 @@ this [here](https://docs.page/bizz84/complete-flutter-course/faq/android-build-g ## Build Production App: +The production entry point is `lib/main.dart`. Run the commands from `app/`. The env file passed to +`--dart-define-from-file` must define `ENV=prod`, because `init.dart` then loads `env/.prod` as the dotenv file. +Create `app/env/.prod` first (following `app/env/.dev`) and don't commit real secrets. + 1. Build your android appBundle or apk: - run the following command to build your appBundle ```text - flutter build appBundle -t lib/main/env/main.dart --dart-define-from-file=env_prod.json + flutter build appbundle -t lib/main.dart --dart-define-from-file=env/.prod ``` [TODO: add how to setup Xcode for apple signIn] @@ -154,7 +158,7 @@ this [here](https://docs.page/bizz84/complete-flutter-course/faq/android-build-g - run the following command to build your ipa ```text - flutter build ipa --release -t lib/main/env/main.dart --dart-define-from-file=env_prod.json + flutter build ipa --release -t lib/main.dart --dart-define-from-file=env/.prod ``` For more information you can check the [docs](https://dartcode.org/docs/launch-configuration/) diff --git a/app/ios/Flutter/Release.xcconfig b/app/ios/Flutter/Release.xcconfig index 0735701..cb19d9a 100644 --- a/app/ios/Flutter/Release.xcconfig +++ b/app/ios/Flutter/Release.xcconfig @@ -1,7 +1,7 @@ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" -FLUTTER_TARGET=lib/main/env/main.dart +FLUTTER_TARGET=lib/main.dart FLUTTER_BUILD_NAME=2.0.0 FLUTTER_BUILD_NUMBER=1 FLUTTER_APP_ID=base diff --git a/app/ios/qa.xcconfig b/app/ios/qa.xcconfig index 3051004..1053c32 100644 --- a/app/ios/qa.xcconfig +++ b/app/ios/qa.xcconfig @@ -1,9 +1,9 @@ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" -FLUTTER_TARGET=lib/main/env/main_dev.dart +FLUTTER_TARGET=lib/main/env/main_qa.dart FLUTTER_BUILD_NAME=2.0.0 FLUTTER_BUILD_NUMBER=1 FLUTTER_APP_ID=base FLUTTER_APP_NAME=RS Base QA -PREFIX=dev \ No newline at end of file +PREFIX=qa \ No newline at end of file