getInstalledApp function

Future<List<AppsModel>> getInstalledApp()

AppInfo

Implementation

Future<List<AppsModel>> getInstalledApp() async {
  if (!isAndroid) return <AppsModel>[];
  final List<Map<dynamic, dynamic>>? appList = await curiosityChannel
      .invokeListMethod<Map<dynamic, dynamic>>('getInstalledApp');
  final List<AppsModel> list = <AppsModel>[];
  if (appList == null) return list;
  if (appList is! List) return list;
  for (final dynamic data in appList) {
    list.add(AppsModel.fromJson(data as Map<dynamic, dynamic>));
  }
  return list;
}