isAppInstalled static method

Future<bool> isAppInstalled(
  1. String packageName
)

Returns whether a given packageName is installed on the device You will then receive in return a boolean

Implementation

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

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