Docs

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.

lib/main.dart
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, probabilistic or unattributed.
  • 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.createLink makes a shareable link for invite and share flows.
  • Conversions that survive offline. Lander.trackEvent writes 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

MemberWhat it does
Lander.initialize(...)Starts the SDK. Call once, before runApp.
Lander.onDeepLinkStream 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.installIdThe random ID of this install.

Full signatures are in the API reference.

How a tap becomes a screen

  1. Someone taps https://acme.golander.link/p-123.
  2. iOS or Android sees that your app has claimed the domain (Lander hosts the apple-app-site-association and assetlinks.json files for you) and opens the app instead of the browser.
  3. The plugin's native code catches the URL and passes it to Dart.
  4. The SDK calls POST /v1/sdk/resolve on api.golander.link. Lander records the open and answers with the link's route (/product/123), params and attribution labels.
  5. Lander.onDeepLink emits a LanderLink, and your router opens link.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
Flutter3.38
Dart3.10
iOS15.0
AndroidAPI 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.

Next steps

On this page