Flutter SDK
lander_flutter receives, resolves and creates Lander links in your Flutter app, and reports conversions.
lander_flutter is the Flutter plugin for Lander. It catches every link that opens your app (Universal Links on iOS, App Links on Android, custom scheme URLs), asks Lander what the link means, and hands your app one tidy LanderLink with the route to open and the data you attached to it.
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:lander_flutter/lander_flutter.dart';
Future<void> main() async {
await Lander.initialize(apiKey: 'pk_live_...', enableLogging: kDebugMode);
runApp(const MyApp());
}
// Later, once your router exists:
Lander.onDeepLink.listen((link) => router.go(link.route, extra: link));That is the whole integration for most apps. The rest of this section explains each piece.
What you get
- One stream for every link. Cold start, warm start and deferred links (after an install) all arrive on
Lander.onDeepLink. - Nothing lost at startup. Links that arrive before anything listens are buffered and replayed in order, so you can subscribe whenever your router is ready.
- No double navigation. The link that launched the app is delivered exactly once, whether you read it from the stream or from
Lander.getInitialLink(). - Honest attribution. Every link says how sure Lander is:
deterministic,probabilisticorunattributed. - Unknown links still arrive. A URL Lander does not know (or cannot reach because the device is offline) still reaches your app with its raw URL.
- Short links from the app.
Lander.createLinkmakes a shareable link for invite and share flows. - Conversions that survive offline.
Lander.trackEventwrites to an on device queue and sends in batches with retries and deduplication. - Privacy first. A random install ID, no fingerprinting, no advertising IDs, no pasteboard reads.
The public API at a glance
| Member | What it does |
|---|---|
Lander.initialize(...) | Starts the SDK. Call once, before runApp. |
Lander.onDeepLink | Stream of every LanderLink the app receives. |
Lander.getInitialLink() | The link that launched the app (or a deferred link), once. |
Lander.claimHandoff(userId) | After sign in, returns a link your backend handed off to that user. |
Lander.createLink(...) | Creates a short link, returns a LanderShortLink. |
Lander.trackEvent(name, ...) | Records a custom conversion event. |
Lander.installId | The random ID of this install. |
Full signatures are in the API reference.
How a tap becomes a screen
- Someone taps
https://acme.golander.link/p-123. - iOS or Android sees that your app has claimed the domain (Lander hosts the
apple-app-site-associationandassetlinks.jsonfiles for you) and opens the app instead of the browser. - The plugin's native code catches the URL and passes it to Dart.
- The SDK calls
POST /v1/sdk/resolveonapi.golander.link. Lander records the open and answers with the link's route (/product/123), params and attribution labels. Lander.onDeepLinkemits aLanderLink, and your router openslink.route.
If the app was not installed, Lander sends the person to the store and, where it can do so honestly, gives the link back on first launch. See Deferred links.
Requirements
| Minimum | |
|---|---|
| Flutter | 3.38 |
| Dart | 3.10 |
| iOS | 15.0 |
| Android | API 24 (Android 7.0) |
The current SDK version is 0.2.0.
Get the package
lander_flutter is on pub.dev: flutter pub add lander_flutter. The source is mirrored at github.com/SwiftwareIO/lander_flutter.