Provides access to Android's native PackageManager API to fetch various information, such as installed applications, packages, permissions, etc.
This plugin is purposed for Android use only. Allowing easier access to most commonly used methods of Android's PackageManager API. Adapted a few methods from existing package package_manager which seems not to be maintained recently.
Importing:
import package:android_package_manager/android_package_manager.dart;
Singleton access example:
final pm = AndroidPackageManager();
Please see official documentation of PackageManager API.
Disclaimer: I have been trying to adapt most of the available methods. Done with some simple instrumentation tests.
Tested methods can be found under example/integration_test
directory.
Example Flutter app demonstrates the getInstalledPackages method.
Please take note of the flags
optional argument on some of the methods. These will affect the
output of the request to the APIs. For example, PackageInfo
won't show any permissions info if
the flag for GET_PERMISSIONS
is not specified.
By default, the list of installed apps is limited on Android 11 (API level 30) and higher. Read more about it here. To access the full list of apps installed on a device, add the following permission to your AndroidManifest.xml
file:
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
- Proper documentation
- DartDocs
- Adjusting some methods to be Android Tiramisu compatible (deprecating some methods)
- Documenting bitmask values
- Separating interfaces into a separate package (maybe)
Feel free to file issues or any suggestions here