feat: dialogs correctly follows Material 3 specifications (#1560)

Signed-off-by: validcube <pun.butrach@gmail.com>
This commit is contained in:
Pun Butrach
2023-12-22 20:34:03 +07:00
committed by GitHub
parent c06d15de5f
commit f8d086a743
21 changed files with 135 additions and 333 deletions

View File

@ -13,7 +13,6 @@ import 'package:revanced_manager/models/patch.dart';
import 'package:revanced_manager/models/patched_application.dart';
import 'package:revanced_manager/services/manager_api.dart';
import 'package:revanced_manager/services/patcher_api.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
import 'package:revanced_manager/utils/about_info.dart';
import 'package:revanced_manager/utils/check_for_supported_patch.dart';
import 'package:stacked/stacked.dart';
@ -56,25 +55,23 @@ class PatcherViewModel extends BaseViewModel {
context: context,
builder: (context) => AlertDialog(
title: I18nText('notice'),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
content: I18nText(
'patcherView.removedPatchesWarningDialogText',
translationParams: {'patches': removedPatches.join('\n')},
),
actions: <Widget>[
CustomMaterialButton(
isFilled: false,
label: I18nText('noButton'),
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: I18nText('noButton'),
),
CustomMaterialButton(
label: I18nText('yesButton'),
FilledButton(
onPressed: () {
Navigator.of(context).pop();
showArmv7WarningDialog(context);
},
child: I18nText('yesButton'),
),
],
),
@ -98,22 +95,20 @@ class PatcherViewModel extends BaseViewModel {
context: context ?? ctx,
builder: (context) => AlertDialog(
title: I18nText('notice'),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
content: I18nText('patcherView.requiredOptionDialogText'),
actions: <Widget>[
CustomMaterialButton(
isFilled: false,
label: I18nText('cancelButton'),
TextButton(
onPressed: () => {
Navigator.of(context).pop(),
},
child: I18nText('cancelButton'),
),
CustomMaterialButton(
label: I18nText('okButton'),
FilledButton(
onPressed: () => {
Navigator.pop(context),
navigateToPatchesSelector(),
},
child: I18nText('okButton'),
),
],
),
@ -131,20 +126,18 @@ class PatcherViewModel extends BaseViewModel {
context: context,
builder: (context) => AlertDialog(
title: I18nText('warning'),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
content: I18nText('patcherView.armv7WarningDialogText'),
actions: <Widget>[
CustomMaterialButton(
label: I18nText('noButton'),
FilledButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('noButton'),
),
CustomMaterialButton(
label: I18nText('yesButton'),
isFilled: false,
TextButton(
onPressed: () {
Navigator.of(context).pop();
navigateToInstaller();
},
child: I18nText('yesButton'),
),
],
),