getAppInfo method

  1. @override
Future<AppInfo> getAppInfo(
  1. String packageName, {
  2. bool shouldInitialize = false,
})
override

Implementation

@override
Future<AppInfo> getAppInfo(
  String packageName, {
  bool shouldInitialize = false,
}) async {
  try {
    final dynamic result = await methodChannel.invokeMethod('getAppInfo', {
      "packageName": packageName,
      "shouldInitialize": shouldInitialize,
    });
    AppInfo appInfo = AppInfo.fromAndroidData(result);
    return appInfo;
  } catch (err) {
    throw Exception("Can't get the application: $err");
  }
}