feat: remove select all patches chip

This commit is contained in:
EvadeMaster 2023-03-19 10:04:16 +07:00
parent c2021d508e
commit 7e05bcac90
No known key found for this signature in database
GPG Key ID: 90BAB50981420F89
2 changed files with 2 additions and 45 deletions

View File

@ -135,7 +135,8 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
Row(
children: [
ActionChip(
label: I18nText('patchesSelectorView.recommended'),
label:
I18nText('patchesSelectorView.recommended'),
tooltip: FlutterI18n.translate(
context,
'patchesSelectorView.recommendedTooltip',
@ -145,18 +146,6 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
},
),
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(
label: I18nText('patchesSelectorView.none'),
tooltip: FlutterI18n.translate(

View File

@ -50,38 +50,6 @@ class PatchesSelectorViewModel extends BaseViewModel {
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() {
selectedPatches.clear();