diff --git a/assets/i18n/en_US.json b/assets/i18n/en_US.json index 1d94a14e..8b13f9ee 100644 --- a/assets/i18n/en_US.json +++ b/assets/i18n/en_US.json @@ -16,6 +16,7 @@ "patchedSubtitle": "Patched Applications", "updatesAvailable": "Updates available", "noUpdates": "No updates available", + "WIP": "Work In Progress", "noInstallations": "No patched applications installed", "installed": "Installed", "updateDialogTitle": "Update Manager", diff --git a/lib/ui/views/home/home_view.dart b/lib/ui/views/home/home_view.dart index df1a2bec..d58598b8 100644 --- a/lib/ui/views/home/home_view.dart +++ b/lib/ui/views/home/home_view.dart @@ -67,20 +67,20 @@ class HomeView extends StatelessWidget { const SizedBox(height: 8), Row( children: [ - DashboardChip( - label: I18nText('homeView.updatesAvailable'), - isSelected: model.showUpdatableApps, - onSelected: (value) { - model.toggleUpdatableApps(true); - }, - ), - const SizedBox(width: 10), DashboardChip( label: I18nText('homeView.installed'), isSelected: !model.showUpdatableApps, onSelected: (value) { model.toggleUpdatableApps(false); }, + ), + const SizedBox(width: 10), + DashboardChip( + label: I18nText('homeView.updatesAvailable'), + isSelected: model.showUpdatableApps, + onSelected: (value) { + model.toggleUpdatableApps(true); + }, ) ], ), diff --git a/lib/ui/views/home/home_viewmodel.dart b/lib/ui/views/home/home_viewmodel.dart index 508cc09a..a23aef03 100644 --- a/lib/ui/views/home/home_viewmodel.dart +++ b/lib/ui/views/home/home_viewmodel.dart @@ -29,7 +29,7 @@ class HomeViewModel extends BaseViewModel { final Toast _toast = locator(); final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); DateTime? _lastUpdate; - bool showUpdatableApps = true; + bool showUpdatableApps = false; List patchedInstalledApps = []; List patchedUpdatableApps = []; diff --git a/lib/ui/widgets/homeView/available_updates_card.dart b/lib/ui/widgets/homeView/available_updates_card.dart index dd4f560b..2a7a6b74 100644 --- a/lib/ui/widgets/homeView/available_updates_card.dart +++ b/lib/ui/widgets/homeView/available_updates_card.dart @@ -14,47 +14,74 @@ class AvailableUpdatesCard extends StatelessWidget { @override Widget build(BuildContext context) { - return apps.isEmpty - ? CustomCard( - child: Center( - child: Column( - children: [ - Icon( - size: 40, - Icons.update_disabled, - color: Theme.of(context).colorScheme.secondary, - ), - const SizedBox(height: 16), - I18nText( - 'homeView.noUpdates', - child: Text( - '', - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.subtitle1!.copyWith( - color: Theme.of(context).colorScheme.secondary, - ), - ), - ) - ], - ), + return CustomCard( + child: Center( + child: Column( + children: [ + Icon( + size: 40, + Icons.update_disabled, + color: Theme.of(context).colorScheme.secondary, ), - ) - : ListView( - shrinkWrap: true, - padding: EdgeInsets.zero, - physics: const NeverScrollableScrollPhysics(), - children: apps - .map((app) => ApplicationItem( - icon: app.icon, - name: app.name, - patchDate: app.patchDate, - changelog: app.changelog, - isUpdatableApp: true, - //TODO: Find a better way to do update functionality - onPressed: () => - locator().updatesAreDisabled(), - )) - .toList(), - ); + const SizedBox(height: 16), + I18nText( + 'homeView.WIP', + child: Text( + '', + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.subtitle1!.copyWith( + color: Theme.of(context).colorScheme.secondary, + ), + ), + ) + ], + ), + ), + ); + // return apps.isEmpty + // ? CustomCard( + // child: Center( + // child: Column( + // children: [ + // Icon( + // size: 40, + // Icons.update_disabled, + // color: Theme.of(context).colorScheme.secondary, + // ), + // const SizedBox(height: 16), + // I18nText( + // 'homeView.noUpdates', + // child: Text( + // '', + // textAlign: TextAlign.center, + // style: Theme.of(context).textTheme.subtitle1!.copyWith( + // color: Theme.of(context).colorScheme.secondary, + // ), + // ), + // ) + // ], + // ), + // ), + // ) + // : ListView( + // shrinkWrap: true, + // padding: EdgeInsets.zero, + // physics: const NeverScrollableScrollPhysics(), + // children: apps + // .map((app) => ApplicationItem( + // icon: app.icon, + // name: app.name, + // patchDate: app.patchDate, + // changelog: app.changelog, + // isUpdatableApp: true, + // //TODO: Find a better way to do update functionality + // onPressed: () {} + // // () => + // // locator().navigateToPatcher( + // // app, + // // ), + // )) + // .toList(), + // ); } } diff --git a/lib/ui/widgets/shared/application_item.dart b/lib/ui/widgets/shared/application_item.dart index 7e9f4838..addf1bf1 100644 --- a/lib/ui/widgets/shared/application_item.dart +++ b/lib/ui/widgets/shared/application_item.dart @@ -110,7 +110,7 @@ class _ApplicationItemState extends State children: [ CustomMaterialButton( label: widget.isUpdatableApp - ? I18nText('applicationItem.infoButton') + ? I18nText('applicationItem.patchButton') : I18nText('applicationItem.infoButton'), onPressed: widget.onPressed, ),