Files
Krow-workspace/mobile-apps/staff-app
..
2025-11-19 00:02:08 -05:00

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
flutter pub run build_runner build --delete-conflicting-outputs

To enable automatic code generation on file changes, use:

dart run build_runner build --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

  1. Open the project in Android Studio.
  2. Go to Edit Configurations.
  3. Add a new run configuration.
  4. Set Environment Variable: ENV=.env_dev for dev or ENV=.env for prod.
  5. 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.