diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index 9ba76d42..0c5d1552 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -92,6 +92,7 @@ class _AppSelectorViewState extends State { name: app.appName, pkgName: app.packageName, icon: app.icon, + patchesCount: model.patchesCount(app.packageName), onTap: () { model.selectApp(app); Navigator.of(context).pop(); diff --git a/lib/ui/views/app_selector/app_selector_viewmodel.dart b/lib/ui/views/app_selector/app_selector_viewmodel.dart index b2205dd0..982b4447 100644 --- a/lib/ui/views/app_selector/app_selector_viewmodel.dart +++ b/lib/ui/views/app_selector/app_selector_viewmodel.dart @@ -15,6 +15,9 @@ class AppSelectorViewModel extends BaseViewModel { final Toast _toast = locator(); final List apps = []; bool noApps = false; + int patchesCount(String packageName) { + return _patcherAPI.getFilteredPatches(packageName).length; + } Future initialize() async { apps.addAll(await _patcherAPI.getFilteredInstalledApps()); diff --git a/lib/ui/widgets/appSelectorView/installed_app_item.dart b/lib/ui/widgets/appSelectorView/installed_app_item.dart index 3ce7641d..d50820b9 100644 --- a/lib/ui/widgets/appSelectorView/installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/installed_app_item.dart @@ -6,6 +6,7 @@ class InstalledAppItem extends StatefulWidget { final String name; final String pkgName; final Uint8List icon; + final int patchesCount; final Function()? onTap; const InstalledAppItem({ @@ -13,6 +14,7 @@ class InstalledAppItem extends StatefulWidget { required this.name, required this.pkgName, required this.icon, + required this.patchesCount, this.onTap, }) : super(key: key); @@ -45,14 +47,29 @@ class _InstalledAppItemState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - widget.name, - maxLines: 2, - overflow: TextOverflow.visible, - style: const TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + widget.name, + maxLines: 2, + overflow: TextOverflow.visible, + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + ), + ), + const SizedBox(width: 6), + Text( + widget.patchesCount == 1 + ? "${widget.patchesCount} patch" + : "${widget.patchesCount} patches", + style: TextStyle( + fontSize: 8, + color: Theme.of(context).colorScheme.secondary, + ), + ), + ], ), const SizedBox(height: 4), Text(widget.pkgName),