Tizen package manager API. Used for getting installed package info.
To use this package, add tizen_package_manager
as a dependency in your pubspec.yaml
file.
dependencies:
tizen_package_manager: ^0.1.0
To retrieve information of a specific package, use the getPackageInfo
method which returns an instance of PackageInfo
.
var packageId = 'org.tizen.settings';
var packageInfo = await PackageManager.getPackageInfo(packageId);
To retrieve information of all packages installed on a Tizen device, use getPackagesInfo
method.
var packageList = await PackageManager.getPackagesInfo();
for (var package in packageList) {
// Handle each package's info.
}
You can listen for package events using onInstallProgressChanged
, onUninstallProgressChanged
, and onUpdateProgressChanged
.
_subscription = PackageManager.onInstallProgressChanged.listen((event) {
// A package is being installed.
});
...
_subscription.cancel();
Privileges are required to use the package manager functionality. Add required privileges in tizen-manifest.xml of your application.
<privileges>
<privilege>http://tizen.org/privilege/packagemanager.info</privilege>
<!-- The below is optional for install/uninstall and platform privilge -->
<privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
</privileges>