From 62467007b230cfe16c0e9a60581bf309e4c35cd8 Mon Sep 17 00:00:00 2001 From: Ushie Date: Wed, 14 Dec 2022 13:20:17 +0300 Subject: [PATCH] Revert "feat: display app's patch count in appcard" This reverts commit 8d4e4ba6c9c30fdade2fcbf79aaaba34c68458ac. --- .../views/app_selector/app_selector_view.dart | 1 - .../app_selector/app_selector_viewmodel.dart | 3 -- .../appSelectorView/installed_app_item.dart | 33 +++++-------------- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index 0c5d1552..9ba76d42 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -92,7 +92,6 @@ 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 1803905c..6802a0ef 100644 --- a/lib/ui/views/app_selector/app_selector_viewmodel.dart +++ b/lib/ui/views/app_selector/app_selector_viewmodel.dart @@ -16,9 +16,6 @@ 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 d50820b9..3ce7641d 100644 --- a/lib/ui/widgets/appSelectorView/installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/installed_app_item.dart @@ -6,7 +6,6 @@ class InstalledAppItem extends StatefulWidget { final String name; final String pkgName; final Uint8List icon; - final int patchesCount; final Function()? onTap; const InstalledAppItem({ @@ -14,7 +13,6 @@ class InstalledAppItem extends StatefulWidget { required this.name, required this.pkgName, required this.icon, - required this.patchesCount, this.onTap, }) : super(key: key); @@ -47,29 +45,14 @@ class _InstalledAppItemState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - 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, - ), - ), - ], + Text( + widget.name, + maxLines: 2, + overflow: TextOverflow.visible, + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + ), ), const SizedBox(height: 4), Text(widget.pkgName),