Meili Flutter Plugin
The Meili Flutter Plugin allows you to integrate the Meili car rental experience into your Flutter applications on both iOS and Android.
Overview
meili_flutter is a federated Flutter plugin that wraps the native Meili UX SDKs:
- Android native SDK: hosted as a Maven artifact on GitHub Packages at
meili-travel-tech/ux-native-android-sdk(requires auth). - iOS native SDK: distributed as a CocoaPod (
MeiliSDK) via a private spec repo atmeili-travel-tech/meili-ios-pods(requires SSH/HTTPS access).
Prerequisites
| Requirement | Why |
|---|---|
Flutter SDK >=3.4.0 |
Minimum required by the plugin. |
| Android Studio / Xcode CLI tools | Needed for native builds. |
CocoaPods (gem install cocoapods) |
iOS dependency manager. |
GitHub Personal Access Token with read:packages scope |
Downloads the Android AAR from GitHub Packages. |
Membership in the meili-travel-tech GitHub org |
Both the iOS spec repo and Android Maven artifacts are under this org. Contact Meili to get access. |
1. Dart / pubspec setup
dependencies:
meili_flutter: 0.3.1-beta.1
flutter pub get
This resolves the federated sub-packages automatically — you do not need to add meili_flutter_android or meili_flutter_ios manually.
2. Android setup
2.1 Declare the Maven repository
The Android SDK is served from a public Maven repository over GitHub Pages, so no credentials are required. Add it to your project-level android/build.gradle.kts:
allprojects {
repositories {
google()
mavenCentral()
maven { url = uri("https://meili-travel-tech.github.io/ux-native-android/") }
}
}
2.2 android/app/build.gradle.kts — NDK + minSdk
android {
ndkVersion = "27.0.12077973"
defaultConfig {
minSdk = 27
}
}
ndkVersionmust be pinned exactly — usingflutter.ndkVersionmay cause a linker error.minSdk = 27is required by the Meili Android SDK.
2.3 android/settings.gradle.kts — Kotlin Compose plugin
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.7.3" apply false
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.1.0" apply false // add this
}
2.4 MainActivity.kt
import io.flutter.embedding.android.FlutterFragmentActivity
class MainActivity : FlutterFragmentActivity()
If you leave
FlutterActivityhere you will get anIllegalStateExceptionat runtime when opening the Meili view.
3. iOS setup
3.1 ios/Podfile
platform :ios, '16.0'
source 'https://cdn.cocoapods.org/'
source 'git@github.com:meili-travel-tech/meili-ios-pods.git'
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
# ... rest of the standard Flutter Podfile unchanged
If you use a multi-account SSH setup, replace
git@github.com:with your Host alias e.g.git@github.com-meili:.
3.2 iOS deployment target
Set IPHONEOS_DEPLOYMENT_TARGET = 16.0 in three places in ios/Runner.xcodeproj/project.pbxproj (Debug, Release, Profile), or via Xcode under Runner target → General → Minimum Deployments → iOS.
3.3 ios/Flutter/AppFrameworkInfo.plist
<key>MinimumOSVersion</key>
<string>16.0</string>
3.4 Install pods
cd ios && pod install --repo-update && cd ..
--repo-update is needed the first time to clone the private spec repo. Plain pod install is sufficient on subsequent runs.
4. Usage
Full-screen modal (iOS and Android)
This is the only supported way to present the booking flow. It opens as a modal over the current screen and works identically on both platforms.
import 'package:meili_flutter/meili_flutter.dart';
await Meili.openMeiliView(MeiliParams(
ptid: 'your-ptid',
env: 'prod',
flow: FlowType.direct,
));
Booking Manager
await Meili.openMeiliView(MeiliParams(
ptid: 'your-ptid',
env: 'prod',
flow: FlowType.bookingManager,
additionalParams: AdditionalParams(
confirmationId: '1234ABCD',
lastName: 'Doe',
),
));
5. Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Could not find ... .aar during Gradle |
Maven repo URL missing, or the version isn't published yet | Check the build.gradle.kts repo block points to the public Pages URL and that the version exists. |
Unable to find a specification for MeiliSDK |
Missing source line in Podfile |
Add the private spec repo URL. |
pod install hangs on first run |
First-time SSH clone of spec repo | Confirm SSH key: ssh -T git@github.com. |
IllegalStateException ... requires FragmentActivity |
MainActivity still extends FlutterActivity |
Change to FlutterFragmentActivity. |
| NDK strip / linker errors | NDK version mismatch | Pin ndkVersion = "27.0.12077973". |
| Env vars set in terminal but not in Android Studio | macOS GUI apps don't load ~/.zshrc |
Move env vars to ~/.zshenv, relaunch Android Studio. |
Platform Support
| Platform | Supported |
|---|---|
| Android | ✅ |
| iOS | ✅ |
Contributing
Open issues or pull requests at github.com/meili-travel-tech/flutter_meili.