- Created google-services.json for staging environment. - Updated firebase.json to include build configurations for dev and staging. - Added flutterfire-config.sh script to generate Firebase configuration files. - Modified Xcode project to include GoogleService-Info.plist for staging. - Created staging.xcscheme for Xcode build configuration. - Added GoogleService-Info.plist for dev and staging flavors. - Generated firebase_options_dev.dart and firebase_options_staging.dart for Firebase initialization.
Instructions and Console Commands for Building and Running the App
📌 Environment Setup
The project uses .env files to manage environment configurations. Available files:
.env– for the production environment.env_dev– for the development environment
Before running or building the app, ensure that the appropriate .env file is correctly configured.
🔧 Code Generation
Before running the app or creating a build, generate the required code:
flutter pub get
dart run build_runner build --delete-conflicting-outputs
To enable automatic code generation on file changes, use:
dart run build_runner watch --delete-conflicting-outputs
🚀 Running the App
▶️ Running in Visual Studio Code
Open the project in VS Code and use the launch.json configuration, or run the following command:
flutter run --flavor dev -t lib/main_dev.dart
For the production environment:
flutter run --flavor prod
▶️ Running in Android Studio
- Open the project in Android Studio.
- Go to Edit Configurations.
- Add a new run configuration.
- Set
Environment Variable: ENV=.env_devfor dev orENV=.envfor prod. - Run the app via the IDE or using the terminal:
flutter run --flavor dev -t lib/main_dev.dart
📦 Building the App
📲 Building an App Bundle for Release
flutter build appbundle --flavor prod --target-platform android-arm,android-arm64,android-x64
📲 Building an APK for Testing
flutter build apk --flavor dev -t lib/main_dev.dart
These commands ensure the app is correctly set up and built according to the selected environment.