isDebugSettingsDeepLink static method

bool isDebugSettingsDeepLink(
  1. Uri uri
)

Whether uri is the SDK's debug-settings deeplink.

Matches the raw string, not Uri.path: for myapp://_digia/debug-settings, URI parsing treats _digia as the host, not the path, so a path-only check would never match a custom scheme.

if (Digia.isDebugSettingsDeepLink(uri)) {
  Digia.openDebugSettings(context);
  return;
}

Implementation

static bool isDebugSettingsDeepLink(Uri uri) {
  final raw = uri.toString();
  final afterScheme =
      raw.contains('://') ? raw.substring(raw.indexOf('://') + 3) : raw;
  final trimmed = afterScheme.replaceAll(RegExp(r'^/+|/+$'), '');
  return trimmed == debugSettingsDeepLinkPath ||
      trimmed.endsWith('/$debugSettingsDeepLinkPath');
}