uninstallApp static method

Future<bool> uninstallApp(
  1. String packageName
)

Uninstall an application by giving its packageName Note: It will only open the Android's screen

Implementation

static Future<bool> uninstallApp(String packageName) {
  if (packageName.isEmpty) {
    throw Exception('The package name can not be empty');
  }

  return _methodChannel
      .invokeMethod<bool>('uninstallApp', <String, String>{
        'package_name': packageName,
      })
      .then((bool? value) => value ?? false)
      .catchError((dynamic err) => false);
}