Flutter App Setup Guide
Welcome to the Smarty mobile application documentation. This guide will help you set up, customize, and build the Flutter app for Android and iOS.
INFO
Prerequisites: Ensure you have Flutter SDK installed (version >= 3.0.0) and an IDE like VS Code or Android Studio.
1. Project Setup
Follow these steps to initialize the project:
- Unzip the
smarty_appsource code. - Open the project folder in your IDE (VS Code or Android Studio).
- Open a terminal in the project root and run:bash
flutter pub get
Running the App
To run the app on a connected device or emulator:
- Connect your Android device (enable USB Debugging) or start an iOS Simulator / Android Emulator.
- Run:bash
flutter run
TIP
You can also press F5 in VS Code or click the Run button in Android Studio.
2. API Configuration
Connect the app to your backend server.
- Navigate to
lib/config/app_config.dart. - Update the
baseUrlvariable with your backend URL.
// lib/config/app_config.dart
class AppConfig {
// Replace with your actual domain
static const String baseUrl = 'https://yourdomain.com';
...
}WARNING
Ensure your backend is running and accessible via HTTPS.
3. AI Chat Configuration
The app includes an intelligent AI Assistant powered by Google Gemini.
1. Admin Panel Setup
- Log in to the Admin Panel.
- Navigate to
System Settings > Gemini AI Configuration. - Enter your Google Gemini API Key.
- Select a Model ID (e.g.,
gemini-1.5-flash). - Toggle the status to Enable and click Save.
INFO
Obtain an API key from Google AI Studio.
2. Mobile App Setup
The mobile app connects to the AI assistant via the backend API.
- Ensure your backend allows access to the
/api/ai/chatendpoint. - The app uses the same authentication token as other requests.
- Prebuilt Suggestions: The app automatically suggests queries like "What is my balance?" or "How do I deposit money?".
3. Payment Gateway Sync
The AI dynamically checks active payment gateways.
- Example: If you disable "Stripe" in
Admin > Payment Gateways, the AI will stop suggesting it as a deposit method.
4. Branding & Customization
Change App Name
To change the display name of the app:
- Open
lib/config/app_config.dartand update theappNamevariable. - Run:bash
flutter pub run rename_app:main all="Your New App Name"
Change Package Name
To change the package name (Bundle ID), run:
flutter pub run change_app_package_name:main com.yourcompany.appnameChange App Logo
The app uses flutter_launcher_icons to generate app icons.
- Replace the logo file at
assets/images/logo.pngwith your own (recommended size: 1024x1024px). - Open
pubspec.yamland verify the configuration:yamlflutter_launcher_icons: android: "launcher_icon" ios: true image_path: "assets/images/logo.png" - Run:bash
flutter pub run flutter_launcher_icons
Change App Colors
To change the primary theme color:
- Open
lib/config/app_config.dart. - Update the
primaryColorvariable.dart// lib/config/app_config.dart class AppConfig { ... static const Color primaryColor = Color(0xFFE2136E); // Change hex code here ... }
5. Build & Deploy
Once ready to publish, use these commands to build release artifacts.
Android (APK & App Bundle)
# Build APK
flutter build apk --release
# Build App Bundle (AAB) for Play Store
flutter build appbundle --releaseiOS (IPA)
# Build IPA for App Store
flutter build ipa --releaseGenerated files are in build/app/outputs/flutter-apk/ (Android) or verify the archive in Xcode (iOS).
