Skip to content

FAQ (Frequently Asked Questions)

1. How do I change the app name?

  • Answer:
    To change the app name, you can either use the customization script or manually update it:
    • Using the Script: Update the app_name field in the customization.yaml file and run:
      bash
      rps customize --appName-only
    • Manually: Open the AndroidManifest.xml file located at android/app/src/main/AndroidManifest.xml and modify the android:label attribute.

2. How do I update the app's package name?

  • Answer:
    The package name can be updated using the customization script or manually:
    • Using the Script: Update the package_name field in the customization.yaml file and run:
      bash
      rps customize --packageName-only
    • Manually: Replace all instances of the old package name with the new one:
      1. Navigate to android/app/src/main/kotlin/com/example/acnoo_pharmacy_app/MainActivity.kt.
      2. Press Ctrl + Shift + R (or equivalent shortcut) to replace the old package name with the new one across the entire project.
      3. Ensure the new package name follows the structure (e.g., com.yourcompany.yourappname).

3. How do I change the backend API URL?

  • Answer:
    You can update the backend API URL either manually or by using the customization script.

Option 1: Manually Update the baseUrl

  1. Open the _app_config.dart file located at /lib/app/core/static/app_config/_app_config.dart.
  2. Modify the baseUrl constant:
    dart
    const String baseUrl = 'https://your-new-domain.com';

Option 2: Use the Customization Script

The app includes a powerful customization script that allows you to easily update the backend API URL along with other configurations. Follow these steps:

  1. Prepare Your customization.yaml File

    • Locate the customization.yaml file in the root directory of the project.
    • Open the file and update the base_url field:
      yaml
      base_url: "https://your-new-domain.com"
  2. Run the Script

    • Open a terminal in the root directory of the project.
    • Use the following command to run the script:
      bash
      rps customize --baseUrl-only
    • This will update only the baseUrl without affecting other configurations.
  3. Verify Changes

    • Restart the app to ensure the new backend API URL is applied.
    • Test the app to confirm it connects successfully to the updated domain.

Note: Make sure to replace https://your-new-domain.com with the correct URL of your backend API. And Remember NOT put a slash (/) at the end of the url.


4. What should I do if flutter doctor shows errors?

  • Answer:
    If flutter doctor reports issues:
    1. Address each error individually:
      • For missing Android licenses, run:
        bash
        flutter doctor --android-licenses
      • For missing dependencies, install the required tools (e.g., Android SDK Command Line Tools).
    2. After resolving the issues, re-run flutter doctor to verify that everything is configured correctly.

5. How do I add a new language for localization?

  • Answer:
    To add a new language:
    1. Duplicate an existing .i18n.json file (e.g., en.i18n.json) and rename it to match the new language code (e.g., fr.i18n.json for French).
    2. Translate the strings in the new file.
    3. Run the following command to update the localization classes:
      bash
      dart run slang
    4. Restart the app to apply the changes.

6. Why are my translations not updating in the app?

  • Answer:
    If translations are not updating:
    1. Ensure all .i18n.json files have consistent keys.
    2. Run the following command to regenerate the localization classes:
      bash
      dart run slang
    3. Hot-reload or restart the app to see the changes.

7. How do I replace the onboarding screen images?

  • Answer:
    To replace the onboarding screen images:
    1. Navigate to the /assets/images/onboard folder.
    2. Replace the existing images (onboard_01.png, onboard_02.png, onboard_03.png) with your custom ones.
    3. Ensure the new images are in .png format and have the same filenames.
    4. Restart the app to see the updated images.

8. How do I change the app icon?

  • Answer:
    To change the app icon:
    1. Replace the existing icon files in the /assets/app folder (app_icon.png, app_launcher_icon.png).
    2. Run the customization script:
      bash
      rps customize --icon-only
    3. Restart the app to see the updated icon.

9. What should I do if the app crashes after making changes?

  • Answer:
    If the app crashes:
    1. Check the terminal or console for error messages.
    2. Use flutter clean to clear cached files and then run:
      bash
      flutter pub get
    3. Verify that all customizations (e.g., package name, API URL) are correctly applied.
    4. Test the app on a different device or emulator to rule out device-specific issues.

10. How do I build a release APK?

  • Answer:
    To build a release APK:
    1. Open a terminal and navigate to the project directory.
    2. Run the following command:
      bash
      flutter build apk --release
    3. Locate the APK in the build/app/outputs/flutter-apk/ directory.

11. Why is my app not connecting to the backend?

  • Answer:
    If the app fails to connect to the backend:
    1. Verify the baseUrl in _app_config.dart is correct.
    2. Ensure the backend server is running and accessible.
    3. Check network permissions in the AndroidManifest.xml file:
      xml
      <uses-permission android:name="android.permission.INTERNET" />

12. How do I test the app on a physical device?

  • Answer:
    To test the app on a physical device:
    1. Enable Developer Options and USB Debugging on your Android device.
    2. Connect the device to your computer via USB.
    3. Run the following command to list connected devices:
      bash
      flutter devices
    4. Start the app on the device:
      bash
      flutter run

13. What should I do if I encounter missing dependencies?

  • Answer:
    If you encounter missing dependencies:
    1. Run the following command to fetch dependencies:
      bash
      flutter pub get
    2. If the issue persists, delete the pubspec.lock file and run flutter pub get again.
    3. Ensure your Flutter SDK is up-to-date by running:
      bash
      flutter upgrade

Released under the MIT License.