openApp static method
Launch an app based on its packageName
You will then receive in return if the app was opened
(will be false if the app is not installed, or if no "launcher" intent is
provided by this app)
Implementation
static Future<bool> openApp(String packageName) {
if (packageName.isEmpty) {
throw Exception('The package name can not be empty');
}
return _methodChannel
.invokeMethod<bool>(
'openApp',
<String, String>{'package_name': packageName},
)
.then((bool? value) => value ?? false)
.catchError((dynamic err) => false);
}