flutter_device_apps 0.5.1
flutter_device_apps: ^0.5.1 copied to clipboard
App-facing API for listing/inspecting installed apps (federated).
flutter_device_apps #
A Flutter plugin to list, inspect, and interact with installed apps on Android devices. Get app details, launch applications, and monitor installation changes programmatically.
Install #
Add to your pubspec.yaml:
dependencies:
flutter_device_apps: latest_version
Quick start #
List apps #
import 'package:flutter_device_apps/flutter_device_apps.dart';
final apps = await FlutterDeviceApps.listApps(
includeSystem: false,
onlyLaunchable: true,
includeIcons: false,
);
for (final app in apps) {
print('${app.appName} • ${app.packageName}');
}
Parameter details:
includeSystem: Include pre-installed system apps like Settings, Phone dialer, etc.onlyLaunchable: Only return apps that have launcher icons. Iffalse, includes all installed packages (libraries, services, background apps).includeIcons: Load app icons as bytes.
Get details for one app #
final info = await FlutterDeviceApps.getApp('com.example.myapp', includeIcon: true);
if (info != null) {
print('Version: ${info.versionName} (${info.versionCode})');
print('Category: ${info.category}');
}
AppInfo fields
| Field | Type | Description |
|---|---|---|
packageName |
String? |
Package ID (e.g. com.example.app) |
appName |
String? |
Display name |
versionName / versionCode |
String? / int? |
Version info |
firstInstallTime / lastUpdateTime |
DateTime? |
Install/update times |
isSystem |
bool? |
Whether the app is a system app |
iconBytes |
Uint8List? |
Icon bytes when requested |
category |
int? |
App category code (e.g. game/social/productivity). |
targetSdkVersion |
int? |
App’s target Android SDK level. |
minSdkVersion |
int? |
Minimum Android SDK level required. |
enabled |
bool? |
Whether the app is currently enabled. |
processName |
String? |
Process name the app runs in. |
installLocation |
int? |
Install preference/location code (auto/internal/external). |
requestedPermissions |
List<String>? |
Permissions declared in the app manifest. |
Open / Settings / Uninstall #
await FlutterDeviceApps.openApp('com.example.myapp');
await FlutterDeviceApps.openAppSettings('com.example.myapp');
await FlutterDeviceApps.uninstallApp('com.example.myapp');
Listen to app changes #
// Start listening to app changes.
late final StreamSubscription sub;
sub = FlutterDeviceApps.appChanges.listen(
(e) {
print('App event: ${e.type} → ${e.packageName}');
switch (e.type) {
case AppChangeType.installed:
print('New app installed: ${e.packageName}');
case AppChangeType.removed:
print('App uninstalled: ${e.packageName}');
case AppChangeType.updated:
print('App updated: ${e.packageName}');
case null:
print('Unknown change type');
}
},
onError: (error) => print('Monitoring error: $error'),
);
// if needed, stop listening to app changes.
await sub.cancel();
Get installer store information #
final store = await FlutterDeviceApps.getInstallerStore('com.example.myapp');
if (store != null) {
print('Installed from: $store');
}
Common installer stores:
"com.android.vending"- Google Play Store"com.sec.android.app.samsungapps"- Samsung Galaxy Store"com.huawei.appmarket"- Huawei AppGallery...
Android notes #
Package visibility (Android 11+) #
No extra permissions needed for basic usage (listing launcher apps and getting app details).
If you need to access ALL apps (including system apps):
If you want listApps() or getApp() to see all installed applications instead of just launchable ones, add this permission to your AndroidManifest.xml:
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
Uninstall permission #
To use the uninstallApp() function, add this permission to your AndroidManifest.xml:
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
License #
MIT © 2026 okmsbun