Skip to main content

Flutter API Reference

The AplikoLink class, its types, EnableDeferred, the paste widgets and errors.

This documentation covers apliko_link 0.1.0 for Flutter.

Types

dart
import 'package:apliko_link/apliko_link.dart';

typedef UrlCallback = void Function(
  String url,
  Map<String, dynamic> data,
  LinkEventMeta meta,
);
typedef Unsubscribe = void Function();

enum LinkSource { initial, runtime, deferred }
class LinkEventMeta { final LinkSource source; }
class CurrentLink { final String url; final Map<String, dynamic> data; final LinkSource source; }

enum DeferredLinkSource { installReferrer, pasteButton }
class DeferredLinkResult {
  final String? url;
  final Map<String, dynamic>? data;
  final DeferredLinkSource? source;
  final String? referrer;
  final bool isAplikoLink; // false by default
}

class EnableDeferred {
  const EnableDeferred({bool? android, bool? ios});
  const EnableDeferred.all(bool enabled);
}

The paste widgets are AplikoPasteHost, AplikoPasteButton and AplikoPaste (show() / hide()), with the option types AplikoPasteButtonOptions, AplikoPasteMode, AplikoPastePresentation, AplikoPastePosition, AplikoPasteTrigger, AplikoPasteCornerStyle and AplikoPasteDisplayMode. Their props and defaults are listed under iOS Paste Widgets.

EnableDeferred

ValueAndroidiOS
omittedonoff
EnableDeferred.all(true)onon
EnableDeferred.all(false)offoff
EnableDeferred(ios: true)on (default)on
EnableDeferred(android: false, ios: true)offon

Deferred links are always off on web and desktop.

Errors

  • Any method called before init() throws StateError with [AplikoLinkManager] Please call init() first. getInitialUrlAsync() and shouldOfferPaste() fail their future instead.
  • An empty apiKey throws ArgumentError with [AplikoLinkManager] apiKey is required.
  • There is no error stream. Failures degrade gracefully: link data becomes {} and a missing link becomes null. Turn on debug to see what happened.