A plugin to get the list of installed applications (iOS is not supported yet).
First, you have to import the package in your dart files with:
import 'package:device_apps/device_apps.dart';
To get the list of the apps installed on the device:
List<Application> apps = await DeviceApps.getInstalledApplications();
You can filter system apps if necessary. Note: The list of apps is not ordered!
You can now get only those apps with launch intent by using the following option. Also add includeSystemApps
option to get all the apps that have launch intent.
// Returns a list of only those apps that have launch intent
List<Application> apps = await DeviceApps.getInstalledApplications(onlyAppsWithLaunchIntent: true, includeSystemApps: true)
To get a specific app by package name:
Application app = await DeviceApps.getApp('com.frandroid.app');
To check if an app is installed (via its package name):
bool isInstalled = await DeviceApps.isAppInstalled('com.frandroid.app');
To open an application
DeviceApps.openApp('com.frandroid.app');
When calling the getInstalledApplications()
or getApp()
methods, you can ask for the icon.
To display the image, just call:
Image.memory(app.icon);