2022-09-05 14:43:13 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
import 'package:revanced_manager/models/patched_application.dart';
|
|
|
|
import 'package:revanced_manager/ui/widgets/appInfoView/app_info_viewmodel.dart';
|
|
|
|
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
|
|
|
import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart';
|
|
|
|
import 'package:stacked/stacked.dart';
|
|
|
|
|
|
|
|
class AppInfoView extends StatelessWidget {
|
|
|
|
final PatchedApplication app;
|
|
|
|
|
|
|
|
const AppInfoView({
|
|
|
|
Key? key,
|
|
|
|
required this.app,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ViewModelBuilder<AppInfoViewModel>.reactive(
|
|
|
|
viewModelBuilder: () => AppInfoViewModel(),
|
|
|
|
builder: (context, model, child) => Scaffold(
|
|
|
|
body: CustomScrollView(
|
|
|
|
slivers: <Widget>[
|
|
|
|
CustomSliverAppBar(
|
|
|
|
title: I18nText(
|
|
|
|
'appInfoView.widgetTitle',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: GoogleFonts.inter(
|
|
|
|
color: Theme.of(context).textTheme.headline6!.color,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SliverPadding(
|
2022-09-19 18:55:44 +02:00
|
|
|
padding: const EdgeInsets.symmetric(vertical: 20.0),
|
2022-09-05 14:43:13 +02:00
|
|
|
sliver: SliverList(
|
|
|
|
delegate: SliverChildListDelegate.fixed(
|
|
|
|
<Widget>[
|
|
|
|
SizedBox(
|
|
|
|
height: 64.0,
|
|
|
|
child: CircleAvatar(
|
2022-09-14 14:14:31 +02:00
|
|
|
backgroundColor: Colors.transparent,
|
2022-09-05 14:43:13 +02:00
|
|
|
child: Image.memory(
|
|
|
|
app.icon,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 20),
|
|
|
|
Text(
|
|
|
|
app.name,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: Theme.of(context).textTheme.headline6,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
Text(
|
|
|
|
app.version,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 20),
|
2022-09-19 18:55:44 +02:00
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
|
|
|
child: CustomCard(
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
child: SizedBox(
|
|
|
|
height: 94.0,
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
child: Material(
|
|
|
|
type: MaterialType.transparency,
|
|
|
|
child: InkWell(
|
|
|
|
borderRadius: BorderRadius.circular(16.0),
|
|
|
|
onTap: () => model.openApp(app),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Icon(
|
|
|
|
Icons.open_in_new_outlined,
|
|
|
|
color: Theme.of(context)
|
|
|
|
.colorScheme
|
|
|
|
.primary,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
I18nText(
|
|
|
|
'appInfoView.openButton',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: TextStyle(
|
|
|
|
color: Theme.of(context)
|
|
|
|
.colorScheme
|
|
|
|
.primary,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
2022-09-05 14:43:13 +02:00
|
|
|
),
|
|
|
|
),
|
2022-09-19 18:55:44 +02:00
|
|
|
),
|
2022-09-17 15:45:43 +02:00
|
|
|
),
|
2022-09-22 10:46:28 +02:00
|
|
|
VerticalDivider(
|
|
|
|
color: Theme.of(context).canvasColor,
|
|
|
|
indent: 12.0,
|
|
|
|
endIndent: 12.0,
|
|
|
|
width: 1.0,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Material(
|
|
|
|
type: MaterialType.transparency,
|
|
|
|
child: InkWell(
|
|
|
|
borderRadius: BorderRadius.circular(16.0),
|
|
|
|
onTap: () => model.showUninstallDialog(
|
|
|
|
context,
|
|
|
|
app,
|
|
|
|
false,
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Icon(
|
|
|
|
Icons.delete_outline,
|
|
|
|
color: Theme.of(context)
|
|
|
|
.colorScheme
|
|
|
|
.primary,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
I18nText(
|
|
|
|
'appInfoView.uninstallButton',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: TextStyle(
|
|
|
|
color: Theme.of(context)
|
|
|
|
.colorScheme
|
|
|
|
.primary,
|
|
|
|
fontWeight: FontWeight.bold,
|
2022-09-19 18:55:44 +02:00
|
|
|
),
|
|
|
|
),
|
2022-09-22 10:46:28 +02:00
|
|
|
),
|
|
|
|
],
|
2022-09-05 14:43:13 +02:00
|
|
|
),
|
|
|
|
),
|
2022-09-19 18:55:44 +02:00
|
|
|
),
|
2022-09-22 10:46:28 +02:00
|
|
|
),
|
2022-09-19 18:55:44 +02:00
|
|
|
VerticalDivider(
|
|
|
|
color: Theme.of(context).canvasColor,
|
|
|
|
indent: 12.0,
|
|
|
|
endIndent: 12.0,
|
|
|
|
width: 1.0,
|
2022-09-05 14:43:13 +02:00
|
|
|
),
|
2022-09-19 18:55:44 +02:00
|
|
|
Expanded(
|
|
|
|
child: Material(
|
|
|
|
type: MaterialType.transparency,
|
|
|
|
child: InkWell(
|
|
|
|
borderRadius: BorderRadius.circular(16.0),
|
|
|
|
onTap: () {
|
|
|
|
model.navigateToPatcher(app);
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
2022-09-18 05:46:21 +02:00
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Icon(
|
2022-09-19 18:55:44 +02:00
|
|
|
Icons.build_outlined,
|
2022-09-17 15:45:43 +02:00
|
|
|
color: Theme.of(context)
|
|
|
|
.colorScheme
|
|
|
|
.primary,
|
|
|
|
),
|
2022-09-18 05:46:21 +02:00
|
|
|
const SizedBox(height: 10),
|
|
|
|
I18nText(
|
2022-09-19 18:55:44 +02:00
|
|
|
'appInfoView.patchButton',
|
2022-09-18 05:46:21 +02:00
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: TextStyle(
|
|
|
|
color: Theme.of(context)
|
|
|
|
.colorScheme
|
|
|
|
.primary,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
2022-09-17 15:45:43 +02:00
|
|
|
),
|
2022-09-19 18:55:44 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (app.isRooted)
|
|
|
|
VerticalDivider(
|
|
|
|
color: Theme.of(context).canvasColor,
|
|
|
|
indent: 12.0,
|
|
|
|
endIndent: 12.0,
|
|
|
|
width: 1.0,
|
|
|
|
),
|
|
|
|
if (app.isRooted)
|
|
|
|
Expanded(
|
|
|
|
child: Material(
|
|
|
|
type: MaterialType.transparency,
|
|
|
|
child: InkWell(
|
2022-09-20 00:25:39 +02:00
|
|
|
borderRadius: BorderRadius.circular(16.0),
|
2022-09-19 18:55:44 +02:00
|
|
|
onTap: () => model.showUninstallDialog(
|
|
|
|
context,
|
|
|
|
app,
|
|
|
|
true,
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Icon(
|
|
|
|
Icons
|
|
|
|
.settings_backup_restore_outlined,
|
|
|
|
color: Theme.of(context)
|
|
|
|
.colorScheme
|
|
|
|
.primary,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
I18nText(
|
|
|
|
'appInfoView.unpatchButton',
|
|
|
|
child: Text(
|
|
|
|
'',
|
|
|
|
style: TextStyle(
|
|
|
|
color: Theme.of(context)
|
|
|
|
.colorScheme
|
|
|
|
.primary,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2022-09-05 14:43:13 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 20),
|
|
|
|
ListTile(
|
2022-09-19 18:55:44 +02:00
|
|
|
contentPadding:
|
|
|
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
2022-09-05 14:43:13 +02:00
|
|
|
title: I18nText(
|
|
|
|
'appInfoView.packageNameLabel',
|
|
|
|
child: const Text(
|
|
|
|
'',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 20,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
subtitle: Text(app.packageName),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
ListTile(
|
2022-09-19 18:55:44 +02:00
|
|
|
contentPadding:
|
|
|
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
2022-09-05 14:43:13 +02:00
|
|
|
title: I18nText(
|
2022-09-06 15:40:49 +02:00
|
|
|
'appInfoView.installTypeLabel',
|
2022-09-05 14:43:13 +02:00
|
|
|
child: const Text(
|
|
|
|
'',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 20,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
2022-09-06 15:40:49 +02:00
|
|
|
subtitle: app.isRooted
|
|
|
|
? I18nText('appInfoView.rootTypeLabel')
|
|
|
|
: I18nText('appInfoView.nonRootTypeLabel'),
|
2022-09-05 14:43:13 +02:00
|
|
|
),
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
ListTile(
|
2022-09-19 18:55:44 +02:00
|
|
|
contentPadding:
|
|
|
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
2022-09-05 14:43:13 +02:00
|
|
|
title: I18nText(
|
|
|
|
'appInfoView.patchedDateLabel',
|
|
|
|
child: const Text(
|
|
|
|
'',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 20,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
subtitle: I18nText(
|
|
|
|
'appInfoView.patchedDateHint',
|
|
|
|
translationParams: {
|
|
|
|
'date': model.getPrettyDate(context, app.patchDate),
|
|
|
|
'time': model.getPrettyTime(context, app.patchDate),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
ListTile(
|
2022-09-19 18:55:44 +02:00
|
|
|
contentPadding:
|
|
|
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
2022-09-05 14:43:13 +02:00
|
|
|
title: I18nText(
|
|
|
|
'appInfoView.appliedPatchesLabel',
|
|
|
|
child: const Text(
|
|
|
|
'',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 20,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
subtitle: I18nText(
|
|
|
|
'appInfoView.appliedPatchesHint',
|
|
|
|
translationParams: {
|
|
|
|
'quantity': app.appliedPatches.length.toString(),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
onTap: () => model.showAppliedPatchesDialog(context, app),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|