fix: disable update functionality for now.

This commit is contained in:
Aunali321 2022-10-11 02:32:23 +05:30
parent 279b76ad53
commit b2a35813f6
5 changed files with 101 additions and 91 deletions

View File

@ -149,7 +149,8 @@
"patchedDateLabel": "Patched Date", "patchedDateLabel": "Patched Date",
"patchedDateHint": "{date} at {time}", "patchedDateHint": "{date} at {time}",
"appliedPatchesLabel": "Applied Patches", "appliedPatchesLabel": "Applied Patches",
"appliedPatchesHint": "{quantity} applied patches" "appliedPatchesHint": "{quantity} applied patches",
"updateNotImplemented": "Update functionality not implemented yet"
}, },
"contributorsView": { "contributorsView": {
"widgetTitle": "Contributors", "widgetTitle": "Contributors",

View File

@ -160,8 +160,9 @@ class AppInfoView extends StatelessWidget {
child: InkWell( child: InkWell(
borderRadius: BorderRadius.circular(16.0), borderRadius: BorderRadius.circular(16.0),
onTap: () { onTap: () {
model.navigateToPatcher(app); model.updateNotImplemented(context);
Navigator.of(context).pop(); // model.navigateToPatcher(app);
// Navigator.of(context).pop();
}, },
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:

View File

@ -8,6 +8,7 @@ import 'package:revanced_manager/models/patched_application.dart';
import 'package:revanced_manager/services/manager_api.dart'; import 'package:revanced_manager/services/manager_api.dart';
import 'package:revanced_manager/services/patcher_api.dart'; import 'package:revanced_manager/services/patcher_api.dart';
import 'package:revanced_manager/services/root_api.dart'; import 'package:revanced_manager/services/root_api.dart';
import 'package:revanced_manager/services/toast.dart';
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart'; import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart'; import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart';
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart'; import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
@ -19,6 +20,7 @@ class AppInfoViewModel extends BaseViewModel {
final ManagerAPI _managerAPI = locator<ManagerAPI>(); final ManagerAPI _managerAPI = locator<ManagerAPI>();
final PatcherAPI _patcherAPI = locator<PatcherAPI>(); final PatcherAPI _patcherAPI = locator<PatcherAPI>();
final RootAPI _rootAPI = RootAPI(); final RootAPI _rootAPI = RootAPI();
final Toast _toast = locator<Toast>();
Future<void> uninstallApp( Future<void> uninstallApp(
BuildContext context, BuildContext context,
@ -51,6 +53,10 @@ class AppInfoViewModel extends BaseViewModel {
locator<NavigationViewModel>().setIndex(1); locator<NavigationViewModel>().setIndex(1);
} }
void updateNotImplemented(BuildContext context) {
_toast.show('appInfoView.updateNotImplemented');
}
Future<void> showUninstallDialog( Future<void> showUninstallDialog(
BuildContext context, BuildContext context,
PatchedApplication app, PatchedApplication app,

View File

@ -50,10 +50,12 @@ class AvailableUpdatesCard extends StatelessWidget {
patchDate: app.patchDate, patchDate: app.patchDate,
changelog: app.changelog, changelog: app.changelog,
isUpdatableApp: true, isUpdatableApp: true,
onPressed: () => //TODO: Find a better way to do update functionality
locator<HomeViewModel>().navigateToPatcher( onPressed: () {}
app, // () =>
), // locator<HomeViewModel>().navigateToPatcher(
// app,
// ),
)) ))
.toList(), .toList(),
); );

View File

@ -110,7 +110,7 @@ class _ApplicationItemState extends State<ApplicationItem>
children: <Widget>[ children: <Widget>[
CustomMaterialButton( CustomMaterialButton(
label: widget.isUpdatableApp label: widget.isUpdatableApp
? I18nText('applicationItem.patchButton') ? I18nText('applicationItem.infoButton')
: I18nText('applicationItem.infoButton'), : I18nText('applicationItem.infoButton'),
onPressed: widget.onPressed, onPressed: widget.onPressed,
), ),
@ -120,7 +120,8 @@ class _ApplicationItemState extends State<ApplicationItem>
), ),
collapsed: const SizedBox(), collapsed: const SizedBox(),
expanded: Padding( expanded: Padding(
padding: const EdgeInsets.only(top: 16.0, left: 4.0, right: 4.0, bottom: 4.0), padding: const EdgeInsets.only(
top: 16.0, left: 4.0, right: 4.0, bottom: 4.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -137,7 +138,6 @@ class _ApplicationItemState extends State<ApplicationItem>
), ),
), ),
), ),
) ));
);
} }
} }