pushDeepLink method

void pushDeepLink(
  1. String url, {
  2. String? path,
  3. Map<String, Object?> data = const {},
  4. bool isDeferred = false,
  5. String? clickId = 'clk_fake_1',
  6. String? matchType,
  7. String linkId = 'lnk_fake_1',
  8. String linkKind = 'standard',
  9. Referral? referral,
})

Delivers a deep link on Clikgate.onDeepLink, as if the phone opened url (or, with isDeferred, as the deferred deep link after install). path defaults to the URL's path. Pump the widget tester afterwards so listeners run.

Implementation

void pushDeepLink(String url,
    {String? path,
    Map<String, Object?> data = const {},
    bool isDeferred = false,
    String? clickId = 'clk_fake_1',
    String? matchType,
    String linkId = 'lnk_fake_1',
    String linkKind = 'standard',
    Referral? referral}) {
  final uri = Uri.parse(url);
  _emit({
    'url': url,
    'path': path ?? (uri.path.isEmpty ? '/' : uri.path),
    'data': data,
    'isDeferred': isDeferred,
    'clickId': clickId,
    'matchType': matchType ?? (isDeferred ? 'install_referrer' : 'app_link'),
    'link': {'id': linkId, 'kind': linkKind},
    if (referral != null) 'referral': _referralMap(referral),
  });
}