|
2 | 2 |
|
3 | 3 | Demonstrates how to use the mparticle_flutter_sdk plugin. |
4 | 4 |
|
5 | | -## Getting Started |
| 5 | +## Prerequisites |
6 | 6 |
|
7 | | -This project is a starting point for a Flutter application. |
| 7 | +- Flutter SDK (stable channel) |
| 8 | +- Xcode 16.4 or later (for iOS development) |
| 9 | +- CocoaPods |
| 10 | +- iOS 13.0+ (minimum deployment target) |
8 | 11 |
|
9 | | -A few resources to get you started if this is your first Flutter project: |
| 12 | +## Setup |
| 13 | + |
| 14 | +### 1. Install Flutter |
| 15 | + |
| 16 | +If Flutter is not installed, follow these steps: |
| 17 | + |
| 18 | +```bash |
| 19 | +# Clone Flutter SDK to your home directory |
| 20 | +cd ~ |
| 21 | +git clone https://github.com/flutter/flutter.git -b stable |
| 22 | + |
| 23 | +# Add Flutter to your PATH in ~/.zshrc |
| 24 | +echo 'export PATH="$HOME/flutter/bin:$PATH"' >> ~/.zshrc |
| 25 | +source ~/.zshrc |
| 26 | + |
| 27 | +# Verify installation |
| 28 | +flutter doctor |
| 29 | +``` |
| 30 | + |
| 31 | +### 2. Install Dependencies |
| 32 | + |
| 33 | +```bash |
| 34 | +# From the example directory |
| 35 | +cd example |
| 36 | + |
| 37 | +# Get Flutter packages |
| 38 | +flutter pub get |
| 39 | + |
| 40 | +# Precache iOS artifacts (first time only) |
| 41 | +flutter precache --ios |
| 42 | +``` |
| 43 | + |
| 44 | +### 3. Install iOS Dependencies |
| 45 | + |
| 46 | +```bash |
| 47 | +# Install CocoaPods dependencies |
| 48 | +cd ios |
| 49 | +pod install |
| 50 | +cd .. |
| 51 | +``` |
| 52 | + |
| 53 | +**Note:** The Podfile has been configured with iOS 13.0 as the minimum deployment target to ensure compatibility with Flutter and mParticle dependencies. |
| 54 | + |
| 55 | +## Running the App |
| 56 | + |
| 57 | +### iOS Simulator |
| 58 | + |
| 59 | +```bash |
| 60 | +# List available devices |
| 61 | +flutter devices |
| 62 | + |
| 63 | +# Run on iOS simulator |
| 64 | +flutter run -d <device-id> |
| 65 | + |
| 66 | +# Or simply |
| 67 | +flutter run |
| 68 | +``` |
| 69 | + |
| 70 | +### iOS Device |
| 71 | + |
| 72 | +```bash |
| 73 | +# Connect your iOS device and ensure it's in Developer Mode |
| 74 | +flutter run -d <your-device-name> |
| 75 | +``` |
| 76 | + |
| 77 | +## Resources |
10 | 78 |
|
11 | 79 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) |
12 | 80 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) |
13 | | - |
14 | | -For help getting started with Flutter, view our |
15 | | -[online documentation](https://flutter.dev/docs), which offers tutorials, |
16 | | -samples, guidance on mobile development, and a full API reference. |
| 81 | +- [Flutter Documentation](https://flutter.dev/docs) |
| 82 | +- [mParticle Documentation](https://docs.mparticle.com/) |
0 commit comments