搜索插件、代码仓与 APP 分类

插件详情v2.2.1

installed_apps

一个与设备上已安装应用相关的实用方法的 Flutter 插件。

Android
近 30 天下载
2.1万
喜欢数
152
Pub 分数
160

安装插件

flutter pub add installed_apps

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

installed_apps 包是一个 Flutter 插件,提供实用方法以获取 Android 设备上已安装应用程序的信息。它使开发者能够列出已安装的应用程序、访问其包名称、标签和其他元数据,从而在 Flutter 应用中实现应用管理功能。该插件专为 Android 设计,可与平台的包管理器无缝集成。该插件轻量级,适用于需要应用发现或设备级别应用分析的场景。

适合场景

  • 在 Android 上列出已安装的应用程序
  • 获取应用包名称
  • 显示应用图标和标签
  • 构建应用程序管理工具
  • 分析设备应用库存

主要特点

  • 仅限 Android 支持
  • 应用程序列表的简单 API
  • 访问包元数据
  • 轻量且高效
  • 无需额外权限

适合对象

  • Android应用开发者
  • 应用发现功能
  • 设备分析工具
  • 自定义应用启动器
  • 系统级应用工具

使用建议

  • 仅限 Android 平台
  • 不支持 iOS
  • 需要 Android SDK 21+
  • 无实时应用安装监控
  • 元数据可能因设备制造商而异

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Installed Apps

Installed Apps is a Flutter plugin that provides utilities to interact with installed apps on a device. You can list installed apps, get app info, launch apps, open settings, and more.

⚠️ Currently, only Android is supported. iOS methods return default/fallback values.


Version 2.0.0 Breaking Changes

Version 2.0.0 has some breaking changes, for example, getInstalledApps now uses **named arguments ** instead of positional arguments as before. Additionally, some other argument names have been updated.

Features

  • List installed apps with optional filters:
    • Exclude system apps
    • Exclude non-launchable apps
    • Filter by package name prefix
    • Filter by platform type
  • Get detailed app info
  • Launch apps by package name
  • Open app settings
  • Check if an app is system or installed
  • Uninstall apps
  • Show toast messages

Installation

flutter pub add installed_apps

Or check the Installation Guide.

Example project: GitHub


Usage

Get Installed Apps
List<AppInfo> apps = await InstalledApps.getInstalledApps(
  // Optional: whether to exclude system apps from the list. Default is true.
  excludeSystemApps: true,

  // Optional: whether to exclude apps that cannot be launched (no launch intent). Default is true.
  excludeNonLaunchableApps: true,

  // Optional: whether to include app icons in the result. Default is false.
  withIcon: false,

  // Optional: filter apps whose package names start with this prefix. Default is null (no filtering).
  packageNamePrefix: "com.example",

  // Optional: filter apps by platform type (Flutter, React Native, etc.). Default is null (no filtering).
  platformType: PlatformType.flutter,
);
Get App Info
AppInfo? app = await InstalledApps.getAppInfo("com.example.myapp");
AppInfo Model
class AppInfo {
  String name;
  Uint8List? icon; // nullable
  String packageName;
  String versionName;
  int versionCode;
  PlatformType platformType;
  int installedTimestamp;
  bool isSystemApp;
  bool isLaunchableApp;
  AppCategory category;
}
Launch App
await InstalledApps.startApp("com.example.myapp");
Open App Settings
InstalledApps.openSettings("com.example.myapp");
Check System App
bool? isSystem = await InstalledApps.isSystemApp("com.example.myapp");
Uninstall App
bool? success = await InstalledApps.uninstallApp("com.example.myapp");
Check if Installed
bool? installed = await InstalledApps.isAppInstalled("com.example.myapp");

AppCategory enum

⚠️ Only available on Android API 28+. On lower SDK versions, all apps will have undefined.

enum AppCategory {
  game(0, "Game"),
  audio(1, "Audio"),
  video(2, "Video"),
  image(3, "Image"),
  social(4, "Social"),
  news(5, "News"),
  maps(6, "Maps"),
  productivity(7, "Productivity"),
  accessibility(8, "Accessibility"),
  undefined(-1, "Undefined");
}

PlatformType enum

enum PlatformType {
  flutter('flutter', 'Flutter'),
  reactNative('react_native', 'React Native'),
  xamarin('xamarin', 'Xamarin'),
  ionic('ionic', 'Ionic'),
  nativeOrOthers('native_or_others', 'Native or Others');
}

QUERY_ALL_PACKAGES Permission and Play Store Review

The QUERY_ALL_PACKAGES permission is required for some functionality of this package, but including it can cause Play Store rejections if your app doesn’t justify it. To handle this, either declare its necessity in the Play Store listing or use tools:node="remove" in your manifest to exclude it while still using the package (note this will limit visibility to all apps). For multi-flavor setups, you can include the permission in src/dev/AndroidManifest.xml for internal/dev builds and remove it in src/playstore/AndroidManifest.xml for Play Store builds, ensuring each flavor has the correct manifest without affecting core functionality.

Notes

  • Android requires QUERY_ALL_PACKAGES permission for full app visibility. Ensure compliance with Play Store policies.
  • All methods catch exceptions and return default/fallback values to prevent crashes.
  • Platform type detection is heuristic and may misclassify some apps. Improvements are ongoing.

Support

If you encounter any issues or have suggestions, please open an issue on GitHub. Contributions and feedback are welcome!

所属分类

源码仓库

使用此插件的项目