Safabites — Safa Bites Captain app
User Application & Web Configuration — consolidated guide

Prerequisites

  • IDE: Android Studio (recommended) or VS Code
  • JDK: JDK 17 (ensure PATH configured)
  • Flutter SDK: version 3.35.6 (stable)
  • Xcode: Xcode 26.0 required for iOS IPA creation (macOS only)
  • Supported platforms: Android, iOS, Web

Environment Setup

Notes: Android Studio Koala (2024.1.2) ships with JDK 17. Verify java -version and flutter doctor after installation.

Windows

  • Download Android Studio (Koala 2024.1.2 recommended).
  • Run installer, choose components (Android Studio, AVD, etc.).
  • Start Android Studio and accept SDK component downloads.
  • Set up emulator via AVD Manager (optional).
  • Install Flutter SDK: extract to C:\flutter and add C:\flutter\bin to PATH.
  • Run flutter doctor and resolve issues.
  • Install Flutter & Dart plugins via Android Studio & restart.

Linux

  • Download Android Studio package and extract: tar -xvzf android-studio-ide-...-linux.tar.gz
  • Move folder to desired location, run ./studio.sh from android-studio/bin.
  • Install Flutter SDK (tar.xz), move to folder, add flutter/bin to PATH.
  • Run flutter doctor, install plugins in Android Studio.

Mac (macOS)

  • Download Android Studio DMG, drag to /Applications, run setup wizard.
  • Install Flutter SDK tarball, move to location and add flutter/bin to PATH.
  • Run flutter doctor and install Xcode (for iOS builds) & command line tools.
  • Install Flutter & Dart plugins from Android Studio → Preferences → Plugins.

Mandatory Setups

  1. Open terminal and run flutter doctor — fix any issues reported.
  2. Open project in Android Studio or VS Code.
  3. Run flutter pub get to fetch dependencies.
  4. To run on device/emulator: flutter run.

Change App Logo & Icon

To replace app branding:

  • App logo: replace assets/images/logo.png with your white/brand logo (use exact filename).
  • App icon: generate icons (e.g., appicon.co) and replace files in android/app/src/main/res/mipmap-* and iOS asset catalogs at ios/Runner/Assets.xcassets.

Change App Name

Set app name in three places:

  • lib/util/app_constrants.dart — set static const String appName = 'YOUR_APP_NAME'
  • android/app/src/main/AndroidManifest.xml — update android:label="YOUR_APP_NAME"
  • ios/Runner/info.plist — update CFBundleDisplayName and CFBundleName

Change Base URL

Set API base URL after backend is deployed:

static const String baseUrl = 'https://your_domain.com';

Do not add a trailing slash (/).

Change App Package (Android)

To change package name:

  1. Open android/app/src/main/AndroidManifest.xml to find current package
  2. In Android Studio, right-click project → Replace in path → replace old package with new package and press "Replace All"

Setup Firebase (Push Notification)

Warning

Create one Firebase project and add multiple apps (User app, Provider app, Serviceman app) to it. Avoid creating duplicate projects.

Android Setup

  1. Add Android app in Firebase with your package name and app display name.
  2. Download google-services.json and place it in android/app/ (replace existing file).
  3. Create a white PNG notification icon and place it at android/app/src/main/res/drawable/notification_icon.png (must be named notification_icon.png).
  4. Update Firebase options in lib/main.dart — set apiKey, appId, messagingSenderId, projectId.

iOS Setup

  1. Add iOS app in the same Firebase project and download GoogleService-Info.plist, then place it under the ios/ folder.
  2. Follow Apple-specific integration steps for push notifications: Firebase Flutter Apple integration.
  3. Paste Firebase Service Account Key into Admin Panel → Firebase Notification section (generate from Firebase console → Service accounts).

Customisation

Country Code (auto)

If you want the app to auto-set the country code at login/register/OTP, configure the country setting in the Admin Panel → Business Settings and update the code picker widget:

// in /lib/common/widgets/custom_text_field_widget.dart countryFilter: [widget.countryDialCode!],

To disable the country chooser dialog, remove showDropDownButton: true and use a fixed country filter param.

Change App Color (Theme)

Update colors in:

  • lib/theme/light_theme.dart — set primaryColor, foregroundColor, secondary
  • lib/theme/dark_theme.dart — update dark variants
Brand colors used in this document:
Primary: #735E3B — Secondary: #B9A787

Build for Android

Basic build command for APK:

flutter build apk

To produce split ABIs (smaller apks):

flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi

For Play Store, prefer AAB:

flutter build appbundle --target-platform android-arm,android-arm64

Signing

  1. Generate keystore and add signing config to android/app/build.gradle.
  2. Keep keystore passwords and files safe (do not commit to source control).

See Flutter docs: https://docs.flutter.dev/deployment/android

Build for iOS

Apple does not allow side-loading. To test on devices and publish, use TestFlight or App Store.

Follow Apple's & Flutter's docs for archiving & uploading:

https://docs.flutter.dev/deployment/ios

Checklist

  • Set bundle identifier in Xcode.
  • Configure provisioning profiles & Apple developer certificates.
  • Archive app in Xcode and export via App Store Connect / TestFlight.