getInstalledApps method
Get all installed apps.
Implementation
@override
Future<List<Map<String, dynamic>>> getInstalledApps({
String appType = 'all',
bool includeIcons = false,
}) async {
try {
final dynamic rawResult = await methodChannel.invokeMethod(
'getInstalledApps',
{
'appType': appType,
'includeIcons': includeIcons,
},
);
if (rawResult is! List) {
throw Exception('Expected List but got ${rawResult.runtimeType}');
}
return rawResult.map((dynamic item) {
if (item is! Map) {
throw Exception('Expected Map but got ${item.runtimeType}');
}
return Map<String, dynamic>.from(item);
}).toList();
} on PlatformException catch (e) {
throw Exception('Failed to get installed apps: ${e.message}');
}
}