openShortcut method

Future<void> openShortcut(
  1. DVInstalledAppShortcut shortcut
)

Starts shortcut the way the app's own launcher entry would.

Implementation

Future<void> openShortcut(DVInstalledAppShortcut shortcut) async {
  final String? answer = await _askHomeApp('shortcuts.open:${shortcut.packageName}:${shortcut.id}');
  if (answer == null) throw UnsupportedError('App shortcuts are opened by an Android home app (dartvel.android.launcher: true).');
  if (answer != 'true') throw StateError('Could not open "${shortcut.label}" in ${shortcut.packageName}.');
}