[英]How to retrieve android installed packages icons in flutter?
I'm trying to make a simple android app that lists the device installed apps with flutter.我正在尝试制作一个简单的 android 应用程序,它列出了设备安装的带有颤振的应用程序。 Now, there is a plugin called PackageInfo that provides an API for querying information about an application package.
现在,有一个名为PackageInfo的插件,它提供了一个 API 来查询有关应用程序包的信息。 But the problem is it only retrieves string information about the package (appName, packageName, version, and buildNumber).
但问题是它只检索有关包的字符串信息(appName、packageName、version 和 buildNumber)。 But in addition to these info, I also want to extract package icon which is problematic because flutter's platform channels only supports general types such as int, string, lists but not platform specific types such as drawables.
但是除了这些信息之外,我还想提取有问题的包图标,因为 Flutter 的平台通道仅支持通用类型,例如 int、string、list,而不支持平台特定类型,例如 drawable。 Any Idea how this can be accomplished?
知道如何做到这一点吗? Thanks
谢谢
You can use device_apps plugin, however only Android allows you to fetch installed apps.您可以使用device_apps插件,但只有 Android 允许您获取已安装的应用程序。
Example:例子:
// list of all apps
List<Application> apps = await DeviceApps.getInstalledApplications();
I think what you are looking for is this . 我认为您正在寻找的是这个。 Although i havent used this plugin myself but they clearly state that this plugin will retrieve all the apps along with all the info and also the icons of respective apps.
虽然我自己没有使用过此插件,但他们明确指出该插件将检索所有应用程序以及所有信息以及相应应用程序的图标。 Launcher Assist Plugin here
Launcher Assist插件在这里
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.