pkgmgr 1.0.7 copy "pkgmgr: ^1.0.7" to clipboard
pkgmgr: ^1.0.7 copied to clipboard

PlatformAndroid

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_PACKAGES in AndroidManifest.xml for 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

2
likes
160
points
95
downloads

Documentation

API reference

Publisher

verified publishernettica.com

Weekly Downloads

Get installed Android apps using the Package Manager API and QUERY_ALL_PACKAGES permission.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on pkgmgr

Packages that implement pkgmgr