Installing Martfury Flutter App
This guide will walk you through the process of setting up the Martfury Flutter mobile application for your Botble E-commerce system.
Requirements
Before installing the Martfury Flutter app, ensure your system meets the following requirements:
Development Environment
- Flutter SDK: 3.7.2 or higher
- Dart SDK: 3.0.0 or higher
- IDE: Android Studio, VS Code, or IntelliJ IDEA
- Git: For version control and cloning the repository
Backend Requirements
- Botble E-commerce Backend: Running instance of Martfury Laravel E-commerce System
- API Access: Botble backend with API endpoints enabled
- HTTPS: Secure connection for API communication (recommended for production)
Platform-Specific Requirements
For Android Development:
- Android Studio with Android SDK
- Android SDK API level 21 (Android 5.0) or higher
- Java Development Kit (JDK) 11 or higher
For iOS Development:
- macOS with Xcode 12.0 or higher
- iOS 12.0 or higher
- Apple Developer Account (for device testing and App Store deployment)
Installation Steps
1. Clone or Download the Repository
Option A: Clone from Git Repository
git clone https://github.com/yourusername/martfury-flutter.git
cd martfury-flutter
Option B: Download Source Code
- Download the source code package
- Extract the zip file to your desired directory
- Navigate to the extracted folder
2. Install Flutter Dependencies
Navigate to the project directory and install all required dependencies:
flutter pub get
This command will download and install all packages listed in the pubspec.yaml
file, including:
- Core Flutter dependencies
- HTTP client for API communication
- State management (GetX)
- Social login packages (Google, Facebook, Apple)
- Firebase services
- UI components and utilities
3. Environment Configuration
Create Environment File
Create a .env
file in the root directory of the project based on the .env.example
template:
cp .env.example .env
Configure Environment Variables
Edit the .env
file with your specific configuration:
# API Configuration
API_BASE_URL=https://your-botble-ecommerce-api.com
APP_NAME=Martfury
APP_ENV=development
# Test Credentials (for development)
TEST_EMAIL=[email protected]
TEST_PASSWORD=your-test-password
# Optional: Additional Configuration
API_TIMEOUT=30000
ENABLE_LOGGING=true
Important Configuration Notes:
- Replace
https://your-botble-ecommerce-api.com
with your actual Botble backend URL - Ensure the backend URL is accessible from your development environment
- Use HTTPS in production for secure API communication
4. Verify Flutter Installation
Before running the app, verify your Flutter installation:
flutter doctor
This command checks your environment and displays a report of the status of your Flutter installation. Address any issues reported.
5. Run the Application
For Development
Run the app in debug mode:
flutter run
For Specific Platform
Run on Android:
flutter run -d android
Run on iOS:
flutter run -d ios
For Web (if supported)
flutter run -d web
Platform-Specific Setup
Android Setup
- Enable Developer Options on your Android device
- Enable USB Debugging in Developer Options
- Connect your device via USB or use an Android emulator
- Verify device connection:bash
flutter devices
iOS Setup
- Open the project in Xcode:bash
open ios/Runner.xcworkspace
- Configure signing in Xcode with your Apple Developer Account
- Connect your iOS device or use the iOS Simulator
- Trust the developer certificate on your device (if using physical device)
Project Structure Overview
After installation, familiarize yourself with the project structure:
lib/
├── core/ # Core functionality and configuration
│ ├── app_config.dart # App configuration settings
│ ├── constants/ # App constants and enums
│ └── utils/ # Utility functions
├── main.dart # Application entry point
└── src/
├── controller/ # Business logic controllers (GetX)
├── model/ # Data models and entities
├── service/ # API services and data providers
├── theme/ # App theme and styling
└── view/ # UI components
├── screen/ # App screens
└── widget/ # Reusable widgets
Verifying Installation
1. App Launch Verification
- Launch the app on your device/emulator
- Verify the splash screen appears
- Check that the onboarding screens load properly
- Ensure the main navigation works
2. API Connection Test
- Navigate to the login screen
- Attempt to log in with test credentials
- Verify API communication is working
- Check that product data loads on the home screen
3. Core Features Test
Test the following core features:
- User authentication (login/register)
- Product browsing and search
- Shopping cart functionality
- Wishlist management
- User profile access
4. Push Notifications Test
- Verify Firebase is properly initialized
- Check FCM token generation in logs
- Test notification permissions (especially on iOS)
- Send test notification from Firebase Console
For detailed push notification setup, see the FCM Setup Guide.
Building for Production
Android APK
flutter build apk --release
Android App Bundle (recommended for Play Store)
flutter build appbundle --release
iOS
flutter build ios --release
Troubleshooting Installation Issues
Common Issues and Solutions
Flutter dependencies issues:
flutter clean
flutter pub get
Gradle build errors (Android):
cd android
./gradlew clean
cd ..
flutter clean
flutter pub get
iOS build errors:
cd ios
rm -rf Pods
rm Podfile.lock
pod install
cd ..
flutter clean
flutter pub get
API connection issues:
- Verify the API_BASE_URL in your
.env
file - Check that the Botble backend is running and accessible
- Ensure CORS is properly configured on the backend
- Test API endpoints using a tool like Postman
Environment file not loading:
- Ensure the
.env
file is in the root directory - Check that the file is not named
.env.txt
- Restart the app after making changes to the
.env
file
Getting Help
If you encounter issues during installation:
- Check the logs: Use
flutter logs
to see detailed error messages - Verify requirements: Ensure all system requirements are met
- Update dependencies: Run
flutter pub upgrade
to update packages - Consult documentation: Check the Flutter documentation
- Contact support: Reach out to our support team with specific error messages
For additional help, please refer to the Troubleshooting section or contact our support team.