Flutter Setup
This guide covers setting up the QR Igniter Flutter mobile application for development and deployment.
Prerequisites
| Requirement | Version | Notes |
|---|---|---|
| Flutter SDK | 3.7.2+ | Latest stable recommended |
| Dart | 3.x | Included with Flutter |
| Xcode | 14+ | macOS only, for iOS |
| Android Studio | 2023+ | For Android development |
| CocoaPods | 1.11+ | macOS only, for iOS dependencies |
Installation
Step 1: Clone Repository
git clone git@git.kickfire.co.uk:web/teec/ignitedqr.git
cd ignitedqr/flutter_app
Step 2: Install Dependencies
flutter pub get
Step 3: iOS Setup (macOS only)
cd ios
pod install
cd ..
Step 4: Verify Installation
flutter doctor
Configuration
API Endpoint
Edit lib/core/constants/app_constants.dart:
class AppConstants {
static const String apiBaseUrl = 'https://qr2.ignited.cloud';
static const String baseUrl = 'https://qr2.ignited.cloud/api/v1';
static const String resolutionBaseUrl = 'https://qr2.ignited.cloud';
}
App Bundle ID
iOS
Edit ios/Runner.xcodeproj/project.pbxproj:
PRODUCT_BUNDLE_IDENTIFIER = com.teec.qrigniter;
Android
Edit android/app/build.gradle:
android {
defaultConfig {
applicationId "com.teec.qrigniter"
}
}
Running the App
Development
# List available devices
flutter devices
# Run on iOS simulator
flutter run -d ios
# Run on Android emulator
flutter run -d android
# Run on specific device
flutter run -d "iPhone 15 Pro"
Hot Reload
Press r in the terminal during development to hot reload changes.
Testing
# Run all tests (33 tests)
flutter test
# Run with coverage
flutter test --coverage
# Run specific test file
flutter test test/services/gs1_parser_service_test.dart
# Generate coverage report
genhtml coverage/lcov.info -o coverage/html
Building for Release
iOS
# Build iOS app
flutter build ios --release
# Open in Xcode for archive
open ios/Runner.xcworkspace
Android
# Build APK
flutter build apk --release
# Build App Bundle (recommended for Play Store)
flutter build appbundle --release
Key Dependencies
| Package | Version | Purpose |
|---|---|---|
| flutter_riverpod | ^2.6.1 | State management |
| go_router | ^14.6.3 | Navigation |
| mobile_scanner | ^6.0.3 | QR code scanning |
| dio | ^5.8.0 | HTTP client |
| flutter_secure_storage | ^9.2.4 | Secure token storage |
| permission_handler | ^11.3.1 | Camera permissions |
Camera Permissions
iOS
Edit ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>Camera access is required to scan QR codes</string>
Android
Edit android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
Troubleshooting
iOS Build Issues
# Clean and rebuild
flutter clean
cd ios && pod deintegrate && pod install && cd ..
flutter build ios
Android Build Issues
# Clean and rebuild
flutter clean
cd android && ./gradlew clean && cd ..
flutter build apk
Next Steps
- App Architecture - Understand the code structure
- GS1 Digital Link - Learn about GS1 parsing