mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: remove select all patches chip
This commit is contained in:
parent
c2021d508e
commit
7e05bcac90
@ -135,7 +135,8 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
ActionChip(
|
ActionChip(
|
||||||
label: I18nText('patchesSelectorView.recommended'),
|
label:
|
||||||
|
I18nText('patchesSelectorView.recommended'),
|
||||||
tooltip: FlutterI18n.translate(
|
tooltip: FlutterI18n.translate(
|
||||||
context,
|
context,
|
||||||
'patchesSelectorView.recommendedTooltip',
|
'patchesSelectorView.recommendedTooltip',
|
||||||
@ -145,18 +146,6 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
ActionChip(
|
|
||||||
label: I18nText('patchesSelectorView.all'),
|
|
||||||
tooltip: FlutterI18n.translate(
|
|
||||||
context,
|
|
||||||
'patchesSelectorView.allTooltip',
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
model.selectAllPatcherWarning(context);
|
|
||||||
model.selectAllPatches(true);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
ActionChip(
|
ActionChip(
|
||||||
label: I18nText('patchesSelectorView.none'),
|
label: I18nText('patchesSelectorView.none'),
|
||||||
tooltip: FlutterI18n.translate(
|
tooltip: FlutterI18n.translate(
|
||||||
|
@ -50,38 +50,6 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> selectAllPatcherWarning(BuildContext context) {
|
|
||||||
return showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => AlertDialog(
|
|
||||||
title: I18nText('warning'),
|
|
||||||
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
|
||||||
content: I18nText('patchesSelectorView.selectAllPatchesWarningContent'),
|
|
||||||
actions: <Widget>[
|
|
||||||
CustomMaterialButton(
|
|
||||||
label: I18nText('okButton'),
|
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void selectAllPatches(bool isSelected) {
|
|
||||||
selectedPatches.clear();
|
|
||||||
|
|
||||||
if (isSelected && _managerAPI.areExperimentalPatchesEnabled() == false) {
|
|
||||||
selectedPatches
|
|
||||||
.addAll(patches.where((element) => isPatchSupported(element)));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isSelected && _managerAPI.areExperimentalPatchesEnabled()) {
|
|
||||||
selectedPatches.addAll(patches);
|
|
||||||
}
|
|
||||||
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
void selectRecommendedPatches() {
|
void selectRecommendedPatches() {
|
||||||
selectedPatches.clear();
|
selectedPatches.clear();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user