mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix(patches-selector): separate all universal patches to the bottom (#1092)
This commit is contained in:
parent
5abcc7191f
commit
0b529c2629
@ -112,6 +112,7 @@
|
|||||||
"patchesSelectorView": {
|
"patchesSelectorView": {
|
||||||
"viewTitle": "Select patches",
|
"viewTitle": "Select patches",
|
||||||
"searchBarHint": "Search patches",
|
"searchBarHint": "Search patches",
|
||||||
|
"universalPatches": "Universal patches",
|
||||||
|
|
||||||
"doneButton": "Done",
|
"doneButton": "Done",
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/material.dart' hide SearchBar;
|
import 'package:flutter/material.dart' hide SearchBar;
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
|
import 'package:revanced_manager/services/manager_api.dart';
|
||||||
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/patchesSelectorView/patch_item.dart';
|
import 'package:revanced_manager/ui/widgets/patchesSelectorView/patch_item.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/shared/custom_popup_menu.dart';
|
import 'package:revanced_manager/ui/widgets/shared/custom_popup_menu.dart';
|
||||||
@ -16,6 +18,7 @@ class PatchesSelectorView extends StatefulWidget {
|
|||||||
|
|
||||||
class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||||
String _query = '';
|
String _query = '';
|
||||||
|
final _managerAPI = locator<ManagerAPI>();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -165,10 +168,10 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
...model
|
...model.getQueriedPatches(_query).map(
|
||||||
.getQueriedPatches(_query)
|
(patch) {
|
||||||
.map(
|
if (patch.compatiblePackages.isNotEmpty) {
|
||||||
(patch) => PatchItem(
|
return PatchItem(
|
||||||
name: patch.name,
|
name: patch.name,
|
||||||
simpleName: patch.getSimpleName(),
|
simpleName: patch.getSimpleName(),
|
||||||
description: patch.description,
|
description: patch.description,
|
||||||
@ -179,9 +182,45 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
isSelected: model.isSelected(patch),
|
isSelected: model.isSelected(patch),
|
||||||
onChanged: (value) =>
|
onChanged: (value) =>
|
||||||
model.selectPatch(patch, value),
|
model.selectPatch(patch, value),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
)
|
if (_managerAPI.areUniversalPatchesEnabled())
|
||||||
.toList(),
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 10.0,
|
||||||
|
),
|
||||||
|
child: I18nText(
|
||||||
|
'patchesSelectorView.universalPatches',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
...model.getQueriedPatches(_query).map((patch) {
|
||||||
|
if (patch.compatiblePackages.isEmpty) {
|
||||||
|
return PatchItem(
|
||||||
|
name: patch.name,
|
||||||
|
simpleName: patch.getSimpleName(),
|
||||||
|
description: patch.description,
|
||||||
|
packageVersion: model.getAppVersion(),
|
||||||
|
supportedPackageVersions:
|
||||||
|
model.getSupportedVersions(patch),
|
||||||
|
isUnsupported: !isPatchSupported(patch),
|
||||||
|
isSelected: model.isSelected(patch),
|
||||||
|
onChanged: (value) =>
|
||||||
|
model.selectPatch(patch, value),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 70.0),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user