feat: display app's patch count in appcard

This commit is contained in:
Ushie
2022-12-14 02:12:57 +03:00
parent d78868b462
commit 8d4e4ba6c9
3 changed files with 29 additions and 8 deletions

View File

@ -92,6 +92,7 @@ class _AppSelectorViewState extends State<AppSelectorView> {
name: app.appName,
pkgName: app.packageName,
icon: app.icon,
patchesCount: model.patchesCount(app.packageName),
onTap: () {
model.selectApp(app);
Navigator.of(context).pop();

View File

@ -15,6 +15,9 @@ class AppSelectorViewModel extends BaseViewModel {
final Toast _toast = locator<Toast>();
final List<ApplicationWithIcon> apps = [];
bool noApps = false;
int patchesCount(String packageName) {
return _patcherAPI.getFilteredPatches(packageName).length;
}
Future<void> initialize() async {
apps.addAll(await _patcherAPI.getFilteredInstalledApps());