Handling Deep & Deferred Links
آخر تحديث: 2026-02-05
Register a single callback that receives both direct and deferred links.
Register a handler early
Register the handler before runApp():
Traput.onLink((link) {
// link.uri is the resolved URI
// link.isDeferred tells you if this came from an install flow
// link.data contains decoded payload / query params (if any)
print('Traput link: ${link.uri} deferred=${link.isDeferred}');
});
Recommended shape
Keep routing logic in one place:
Traput.onLink((link) {
final uri = link.uri;
// Example: /r/product/123?source=email
final source = uri.queryParameters['source'];
if (source != null) {
// track attribution
}
// Navigate based on uri
// navigator.pushNamed(...)
});
Next: /docs/receiving-link-data and /docs/deferred-flow.