getAppInfo static method

Future<AppInfo> getAppInfo(
  1. String packageName
)

Retrieves information about an app with the specified package name.

packageName is the package name of the app to retrieve information for.

Returns an AppInfo object representing the app.

Implementation

static Future<AppInfo> getAppInfo(String packageName) async {
  var app = await _channel.invokeMethod(
    "getAppInfo",
    {"package_name": packageName},
  );
  if (app == null) {
    throw ("App not found with provided package name $packageName");
  } else {
    return AppInfo.create(app);
  }
}