mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: improve explanation of update being unusable
This commit is contained in:
parent
ac79765372
commit
caa9694543
@ -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",
|
||||
|
@ -67,20 +67,20 @@ class HomeView extends StatelessWidget {
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
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);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
|
@ -29,7 +29,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
final Toast _toast = locator<Toast>();
|
||||
final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
||||
DateTime? _lastUpdate;
|
||||
bool showUpdatableApps = true;
|
||||
bool showUpdatableApps = false;
|
||||
List<PatchedApplication> patchedInstalledApps = [];
|
||||
List<PatchedApplication> patchedUpdatableApps = [];
|
||||
|
||||
|
@ -14,47 +14,74 @@ class AvailableUpdatesCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return apps.isEmpty
|
||||
? CustomCard(
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
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: <Widget>[
|
||||
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<HomeViewModel>().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: <Widget>[
|
||||
// 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<HomeViewModel>().navigateToPatcher(
|
||||
// // app,
|
||||
// // ),
|
||||
// ))
|
||||
// .toList(),
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ class _ApplicationItemState extends State<ApplicationItem>
|
||||
children: <Widget>[
|
||||
CustomMaterialButton(
|
||||
label: widget.isUpdatableApp
|
||||
? I18nText('applicationItem.infoButton')
|
||||
? I18nText('applicationItem.patchButton')
|
||||
: I18nText('applicationItem.infoButton'),
|
||||
onPressed: widget.onPressed,
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user