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;
}
DetourLink
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 value | String value |
|---|---|
| General | |
DetourEventName.login | login |
DetourEventName.search | search |
DetourEventName.share | share |
DetourEventName.signUp | sign_up |
DetourEventName.tutorialBegin | tutorial_begin |
DetourEventName.tutorialComplete | tutorial_complete |
DetourEventName.reEngage | re_engage |
DetourEventName.invite | invite |
DetourEventName.openedFromPushNotification | opened_from_push_notification |
| Sales | |
DetourEventName.addPaymentInfo | add_payment_info |
DetourEventName.addShippingInfo | add_shipping_info |
DetourEventName.addToCart | add_to_cart |
DetourEventName.removeFromCart | remove_from_cart |
DetourEventName.refund | refund |
DetourEventName.viewItem | view_item |
DetourEventName.beginCheckout | begin_checkout |
DetourEventName.purchase | purchase |
DetourEventName.adImpression | ad_impression |
Notes
logEventaccepts only predefinedDetourEventNameenum values.- Flutter bridge does not expose
mountAnalytics,unmountAnalytics, orresetSessionin1.0.1.