execute method

  1. @override
void execute(
  1. BuildContext context, {
  2. Map<String, dynamic>? arguments,
})
override

Implementation

@override
void execute(BuildContext context, {Map<String, dynamic>? arguments}) async {
  assert(url != null || route != null, 'One of url or route must be set.');

  if (linkType == LinkType.route && route != null) {
    _performNavigation(context, routeId: route!.ref);
    return;
  }

  final uri = Uri.parse(url!);

  if (uri.scheme.startsWith('http')) {
    vyuh.router.push('/__system_navigate__', extra: uri);

    return;
  }

  final localRoute = vyuh.router.instance.configuration.findMatch(uri);
  var isLocal = localRoute.isNotEmpty;

  if (isLocal) {
    navigationType.apply(context, uri.toString());
    return;
  }

  _performNavigation(context, uri: uri);
}