mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 12:47:37 +02:00
feat: sort by amount of patches, display patches count, setting to enable universal patches (#593)
* feat: sort by amount of patches * feat: display patches count in application card * feat: setting to enable universal patches
This commit is contained in:
@ -6,6 +6,7 @@ class InstalledAppItem extends StatefulWidget {
|
||||
final String name;
|
||||
final String pkgName;
|
||||
final Uint8List icon;
|
||||
final int patchesCount;
|
||||
final Function()? onTap;
|
||||
|
||||
const InstalledAppItem({
|
||||
@ -13,6 +14,7 @@ class InstalledAppItem extends StatefulWidget {
|
||||
required this.name,
|
||||
required this.pkgName,
|
||||
required this.icon,
|
||||
required this.patchesCount,
|
||||
this.onTap,
|
||||
}) : super(key: key);
|
||||
|
||||
@ -45,14 +47,29 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.visible,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.visible,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
widget.patchesCount == 1
|
||||
? "${widget.patchesCount} patch"
|
||||
: "${widget.patchesCount} patches",
|
||||
style: TextStyle(
|
||||
fontSize: 8,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(widget.pkgName),
|
||||
|
@ -6,6 +6,7 @@ import 'package:revanced_manager/ui/views/settings/settingsFragement/settings_ma
|
||||
import 'package:revanced_manager/ui/views/settings/settingsFragement/settings_manage_sources.dart';
|
||||
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_experimental_patches.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_experimental_universal_patches.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart';
|
||||
|
||||
final _settingsViewModel = SettingsViewModel();
|
||||
@ -20,6 +21,7 @@ class SAdvancedSection extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
SManageApiUrlUI(),
|
||||
SManageSourcesUI(),
|
||||
SExperimentalUniversalPatches(),
|
||||
SExperimentalPatches(),
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
|
@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/custom_switch_tile.dart';
|
||||
|
||||
class SExperimentalUniversalPatches extends StatefulWidget {
|
||||
const SExperimentalUniversalPatches({super.key});
|
||||
|
||||
@override
|
||||
State<SExperimentalUniversalPatches> createState() => _SExperimentalUniversalPatchesState();
|
||||
}
|
||||
|
||||
final _settingsViewModel = SettingsViewModel();
|
||||
|
||||
class _SExperimentalUniversalPatchesState extends State<SExperimentalUniversalPatches> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomSwitchTile(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
title: I18nText(
|
||||
'settingsView.experimentalUniversalPatchesLabel',
|
||||
child: const Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
subtitle: I18nText('settingsView.experimentalUniversalPatchesHint'),
|
||||
value: _settingsViewModel.areUniversalPatchesEnabled(),
|
||||
onTap: (value) {
|
||||
setState(() {
|
||||
_settingsViewModel.showUniversalPatches(value);
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user