execute method

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

Implementation

@override
FutureOr<void> execute(BuildContext context,
    {Map<String, dynamic>? arguments}) async {
  if (url == null || url!.isEmpty) {
    vyuh.log.debug('No url provided to open');
  }

  final canLaunch = await canLaunchUrlString(url!);
  if (canLaunch == false) {
    vyuh.log.debug('Unable to launch url: $url');
    return;
  }

  await launchUrlString(url!, mode: mode.launchMode);
}