pkgmgr 1.0.7
pkgmgr: ^1.0.7 copied to clipboard
Get installed Android apps using the Package Manager API and QUERY_ALL_PACKAGES permission.
pkgmgr #
Flutter plugin to list installed apps on Android using the Package Manager API with the QUERY_ALL_PACKAGES permission. Returns app name, package id, and icon data as base64 PNG.
This plugin only implements Android. It can still be a dependency of apps that build for other Flutter platforms, but calls should be guarded so they only run on Android.
Android Setup #
- The plugin requests
QUERY_ALL_PACKAGESinAndroidManifest.xmlfor full package visibility. - No additional setup is required.
Usage #
import 'package:flutter/foundation.dart';
import 'package:pkgmgr/pkgmgr.dart';
void main() async {
if (kIsWeb || defaultTargetPlatform != TargetPlatform.android) {
return;
}
final pkgmgr = Pkgmgr();
final apps = await pkgmgr.getInstalledApps();
for (final app in apps) {
print('Name: \\${app.name}, Package: \\${app.packageId}');
// app.iconBase64 is a base64-encoded PNG
}
}
Building from Command Line #
Run:
flutter build apk
License #
MIT