Mobile App Documentation
TaskFlow is built using Flutter, offering a high-performance experience across Android, iOS, and the Web. This guide will help you set up the development environment, connect to the backend, and build your app for release.
Technical Requirements
Ensure your development machine has the following:
- Flutter SDK: Version 3.19.0 or higher.
- Dart SDK: Automatically included with Flutter.
- IDE: Visual Studio Code (recommended) or Android Studio.
- Native Tools:
- Android: Android SDK and Java Development Kit (JDK).
- iOS: macOS with the latest version of Xcode.
App Setup & Connectivity
1. Initialize the Project
- Open the
task_flow_flutter_appfolder in your IDE. - Run the following command in the terminal to fetch dependencies:bash
flutter pub get
2. Connect to the Backend
You must point the Flutter app to your hosted Laravel API.
- Open
lib/core/config/api_config.dart. - Update the
baseUrlwith your domain:dartstatic const String baseUrl = 'https://yourdomain.com/api';
IMPORTANT
Android Emulator: Use your actual domain or https://10.0.2.2/api for local testing. Avoid localhost.
Running the App
platforms
- Android: Connect a device or start an emulator and run
flutter run. - iOS: Open
ios/Runner.xcworkspacein Xcode, select a device, and run. - Web: Run
flutter run -d chrome.
Deployment & Release
1. Building for Android (APK & AAB)
Generate a Keystore
- Run this command to create a secure signing key:bash
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload - Create a
key.propertiesfile in theandroid/directory:propertiesstorePassword=your_password keyPassword=your_password keyAlias=upload storeFile=/path/to/upload-keystore.jks
Build Commands
- Universal APK:
flutter build apk --release - App Bundle (Play Store):
flutter build appbundle --release
2. Building for iOS
- Xcode Configuration:
- Open
ios/Runner.xcworkspace. - Under Signing & Capabilities, select your Apple Developer Team.
- Ensure you have a unique Bundle Identifier.
- Open
- Build:bash
flutter build ios --release - Archive: In Xcode, go to Product -> Archive to prepare the app for App Store Connect.
Changing Android Package Name
Changing the package name (Application ID) is critical before publishing.
Manual Steps:
- build.gradle: Update
applicationIdinandroid/app/build.gradle. - AndroidManifest.xml: Update the
packageattribute inandroid/app/src/main/AndroidManifest.xml. - Directory Structure: Rename the folders in
android/app/src/main/kotlin/to match your new ID (e.g.,com/yourcompany/yourapp). - MainActivity.kt: Update the package declaration at the top of the file.
Shortcut:
You can use the change_app_package_name package:
bash
flutter pub run change_app_package_name:main com.new.package.nameWARNING
Change the package name BEFORE your first Play Store upload. It cannot be changed afterward.
