FFXDynamicLinks class final

Dynamic Links (specs/34): short links on the project's link host, https://<host>/<code>, that open this app on a route.

import 'package:flutterflow_cloud/dynamic_links.dart';

final links = FlutterFlowCloud.instance.dynamicLinks;
if (links.isConfigured) {
  final link = await links.createLinkToLocation(
    GoRouterState.of(context).uri.toString(),
    title: product.name,
  );
  // share link
}
// The router's link resolver:
linkResolver: links.locationOf,

The link host and scheme come from the build (FFX_LINK_DOMAIN, FFX_LINK_SCHEME), which carries them only for a project registered for Dynamic Links; without them the module is off: it sends nothing, open answers FFXNotALink, and making or resolving a link throws FFXDynamicLinksNotConfiguredError. Against an emulator the app was pointed at (useEmulator, emulatorUrl) the emulator is the link host. A backend a preview injected (App Preview, a shared app) is never one, so there the module follows the build's defines alone.

Properties

domain → String?
The link host, my-app-a1b2c3-link-dev.flutterflow.cloud (the emulator's host and port against an emulator); null when off.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isConfigured → bool
Whether this build makes and opens links: it carries a link host, or the instance talks to an emulator it was pointed at.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scheme → String?
The app's custom URL scheme, behind the iOS page's "Open in app"; null when the build carries none.
final

Methods

Makes a link to path (/product) opened with parameters as its query, and answers its URL, https://<host>/<code>.
createLinkToLocation(String location, {String? title, String? description, String? imageUrl, FFXLinkCampaign campaign = FFXLinkCampaign.empty, String? name, bool forceRedirect = false}) → Future<Uri>
createLink for a router location (/product?id=42), such as GoRouterState.of(context).uri.toString(). utm_* keys in its query are left out: they say how this visitor arrived, not what the page is.
Whether uri is a link on this app's host: one short code as its path. No network.
locationOf(Uri uri) → Future<String?>
open's location: the router's link resolver. Null when uri isn't Dynamic Links', / when it is a link that doesn't resolve.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open(Uri uri) → Future<FFXLinkOpen>
What uri opens: a link on this app's host (resolved, its open reported), an "Open in app" URL on the app's scheme, or neither. Never throws. The same URL asked again while it resolves, or within 2 s after, answers the first result and reports nothing more.
reportResolveFailed(String code) → void
Tells the host code didn't resolve, for an app that resolves links itself. Sent in the background; never throws.
resolve(String code) → Future<FFXDynamicLink?>
The link code names on this app's host; null when the host doesn't know it, it was turned off, or it was made on another host. Reports nothing; open does. Throws FFXDynamicLinksNotConfiguredError when off, and FFXApiError when the host can't be reached after its retries (up to four attempts, at most 3 s of waiting between them).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited