Skip to main content

API Reference

DetourService

High-level orchestration layer for routing-safe integration.

final detour = DetourService();

Constructor

DetourService({
Duration duplicateSuppressionWindow = const Duration(seconds: 2),
})

Properties

bool get isStarted
bool get isInitialLinkProcessed
DetourIntent? get pendingIntent

Methods

Future<void> start(DetourConfig config)
Future<DetourResult> processLink(String url, {bool emitIntent = true})
Future<void> logEvent(DetourEventName eventName, {Map<String, dynamic>? data})
Future<void> logRetention(String eventName)
void consumePendingIntent()
Future<void> stop()

DetourFlutterPlugin

Low-level method/event-channel bridge.

final plugin = DetourFlutterPlugin();

Methods

Future<void> configure(DetourConfig config)
Future<DetourResult> resolveInitialLink()
Future<DetourResult> processLink(String url)
Stream<DetourResult> get linkStream
Future<void> logEvent(DetourEventName eventName, {Map<String, dynamic>? data})
Future<void> logRetention(String eventName)

Types

DetourConfig

class DetourConfig {
final String apiKey;
final String appID;
final bool shouldUseClipboard;
final LinkProcessingMode linkProcessingMode;
}

DetourIntent

class DetourIntent {
final DetourLink link;
final DetourIntentSource source;
final DateTime receivedAt;
}

DetourIntentSource

enum DetourIntentSource {
initial,
runtime,
manual,
}

DetourResult

class DetourResult {
final bool processed;
final DetourLink? link;
}
class DetourLink {
final String url;
final String route;
final String pathname;
final Map<String, String> params;
final LinkType type;
}

LinkType

enum LinkType {
deferred,
verified,
scheme,
}

LinkProcessingMode

enum LinkProcessingMode {
all,
webOnly,
deferredOnly,
}

DetourEventName

Standard event names for use with logEvent().

Enum valueString value
General
DetourEventName.loginlogin
DetourEventName.searchsearch
DetourEventName.shareshare
DetourEventName.signUpsign_up
DetourEventName.tutorialBegintutorial_begin
DetourEventName.tutorialCompletetutorial_complete
DetourEventName.reEngagere_engage
DetourEventName.inviteinvite
DetourEventName.openedFromPushNotificationopened_from_push_notification
Sales
DetourEventName.addPaymentInfoadd_payment_info
DetourEventName.addShippingInfoadd_shipping_info
DetourEventName.addToCartadd_to_cart
DetourEventName.removeFromCartremove_from_cart
DetourEventName.refundrefund
DetourEventName.viewItemview_item
DetourEventName.beginCheckoutbegin_checkout
DetourEventName.purchasepurchase
DetourEventName.adImpressionad_impression

Notes

  • logEvent accepts only predefined DetourEventName enum values.
  • Flutter bridge does not expose mountAnalytics, unmountAnalytics, or resetSession in 1.0.1.