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
-
createLink(
{required String path, Map< String, String> parameters = const {}, String? title, String? description, String? imageUrl, FFXLinkCampaign campaign = FFXLinkCampaign.empty, String? name, bool forceRedirect = false}) → Future<Uri> -
Makes a link to
path(/product) opened withparametersas 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 asGoRouterState.of(context).uri.toString().utm_*keys in its query are left out: they say how this visitor arrived, not what the page is. -
isLink(
Uri uri) → bool -
Whether
uriis 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
uriisn'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
uriopens: 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
codedidn't resolve, for an app that resolves links itself. Sent in the background; never throws. -
resolve(
String code) → Future< FFXDynamicLink?> -
The link
codenames 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