getInstalledApps method

  1. @override
Future<List<AppInfo>> getInstalledApps([
  1. bool excludeSystemApps = true,
  2. String packageNamePrefix = ""
])
override

Implementation

@override
Future<List<AppInfo>> getInstalledApps([
  bool excludeSystemApps = true,
  String packageNamePrefix = "",
]) async {
  List<dynamic> result = await methodChannel.invokeMethod(
    'getInstalledApps',
    {
      "exclude_system_apps": excludeSystemApps,
      "package_name_prefix": packageNamePrefix,
    },
  );
  List<AppInfo> appInfoList = result.map((app) => AppInfo.create(app)).toList();
  appInfoList.sort(
    (a, b) => (a.name ?? "").compareTo(b.name ?? ""),
  );
  return appInfoList;
}