getInstalledAppsPaginated method
Future<Page<AppInfo> >
getInstalledAppsPaginated({
- bool includeSystemApps = false,
- int limit = 50,
- int offset = 0,
- String? searchQuery,
- AppSortBy sortBy = AppSortBy.appName,
- SortOrder sortOrder = SortOrder.ascending,
override
Implementation
@override
Future<Page<AppInfo>> getInstalledAppsPaginated({
bool includeSystemApps = false,
int limit = 50,
int offset = 0,
String? searchQuery,
AppSortBy sortBy = AppSortBy.appName,
SortOrder sortOrder = SortOrder.ascending,
}) async {
final Map<dynamic, dynamic>? result = await methodChannel
.invokeMethod('getInstalledAppsPaginated', {
'includeSystemApps': includeSystemApps,
'limit': limit,
'offset': offset,
'searchQuery': searchQuery,
'sortBy': sortBy.name,
'sortOrder': sortOrder.name,
});
if (result == null)
return Page<AppInfo>(items: [], isLastPage: true, totalCount: 0);
final List<dynamic> items = result['items'] ?? [];
return Page<AppInfo>(
items: items.map((map) => AppInfo.fromMap(map)).toList(),
isLastPage: result['isLastPage'] ?? true,
totalCount: result['totalCount'] ?? 0,
);
}