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",
"patchedDateHint": "{date} at {time}",
"appliedPatchesLabel": "Applied Patches",
"appliedPatchesHint": "{quantity} applied patches"
"appliedPatchesHint": "{quantity} applied patches",
"updateNotImplemented": "Update functionality not implemented yet"
},
"contributorsView": {
"widgetTitle": "Contributors",

View File

@ -160,8 +160,9 @@ class AppInfoView extends StatelessWidget {
child: InkWell(
borderRadius: BorderRadius.circular(16.0),
onTap: () {
model.navigateToPatcher(app);
Navigator.of(context).pop();
model.updateNotImplemented(context);
// model.navigateToPatcher(app);
// Navigator.of(context).pop();
},
child: Column(
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/patcher_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/navigation/navigation_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 PatcherAPI _patcherAPI = locator<PatcherAPI>();
final RootAPI _rootAPI = RootAPI();
final Toast _toast = locator<Toast>();
Future<void> uninstallApp(
BuildContext context,
@ -51,6 +53,10 @@ class AppInfoViewModel extends BaseViewModel {
locator<NavigationViewModel>().setIndex(1);
}
void updateNotImplemented(BuildContext context) {
_toast.show('appInfoView.updateNotImplemented');
}
Future<void> showUninstallDialog(
BuildContext context,
PatchedApplication app,

View File

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

View File

@ -110,7 +110,7 @@ class _ApplicationItemState extends State<ApplicationItem>
children: <Widget>[
CustomMaterialButton(
label: widget.isUpdatableApp
? I18nText('applicationItem.patchButton')
? I18nText('applicationItem.infoButton')
: I18nText('applicationItem.infoButton'),
onPressed: widget.onPressed,
),
@ -120,7 +120,8 @@ class _ApplicationItemState extends State<ApplicationItem>
),
collapsed: const SizedBox(),
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@ -137,7 +138,6 @@ class _ApplicationItemState extends State<ApplicationItem>
),
),
),
)
);
));
}
}