parseList static method

List<AppInfo> parseList(
  1. dynamic apps
)

Implementation

static List<AppInfo> parseList(dynamic apps) {
  if (apps == null || apps is! List || apps.isEmpty) return [];
  final List<AppInfo> appInfoList = apps
      .where((element) =>
          element is Map &&
          element.containsKey("name") &&
          element.containsKey("package_name"))
      .map((app) => AppInfo.create(app))
      .toList();
  appInfoList.sort((a, b) => a.name.compareTo(b.name));
  return appInfoList;
}