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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 135 additions and 333 deletions

View file

@ -7,7 +7,6 @@ import 'package:revanced_manager/services/manager_api.dart';
import 'package:revanced_manager/services/toast.dart';
import 'package:revanced_manager/ui/widgets/settingsView/custom_text_field.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_tile_dialog.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
import 'package:stacked/stacked.dart';
class SManageSources extends BaseViewModel {
@ -43,7 +42,6 @@ class SManageSources extends BaseViewModel {
),
],
),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
content: SingleChildScrollView(
child: Column(
children: <Widget>[
@ -107,9 +105,7 @@ class SManageSources extends BaseViewModel {
),
),
actions: <Widget>[
CustomMaterialButton(
isFilled: false,
label: I18nText('cancelButton'),
TextButton(
onPressed: () {
_orgPatSourceController.clear();
_patSourceController.clear();
@ -117,9 +113,9 @@ class SManageSources extends BaseViewModel {
_intSourceController.clear();
Navigator.of(context).pop();
},
child: I18nText('cancelButton'),
),
CustomMaterialButton(
label: I18nText('okButton'),
FilledButton(
onPressed: () {
_managerAPI.setRepoUrl(_hostSourceController.text.trim());
_managerAPI.setPatchesRepo(
@ -133,6 +129,7 @@ class SManageSources extends BaseViewModel {
_toast.showBottom('settingsView.restartAppForChanges');
Navigator.of(context).pop();
},
child: I18nText('okButton'),
),
],
),
@ -144,16 +141,13 @@ class SManageSources extends BaseViewModel {
context: context,
builder: (context) => AlertDialog(
title: I18nText('settingsView.sourcesResetDialogTitle'),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
content: I18nText('settingsView.sourcesResetDialogText'),
actions: <Widget>[
CustomMaterialButton(
isFilled: false,
label: I18nText('noButton'),
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('noButton'),
),
CustomMaterialButton(
label: I18nText('yesButton'),
FilledButton(
onPressed: () {
_managerAPI.setRepoUrl('');
_managerAPI.setPatchesRepo('');
@ -165,6 +159,7 @@ class SManageSources extends BaseViewModel {
..pop()
..pop();
},
child: I18nText('yesButton'),
),
],
),