chore: cancel button not visible in [Reset to Default] for shortcuts(#7171) (#7257)

This commit is contained in:
Morn 2025-01-23 13:58:48 +08:00 committed by GitHub
parent dd812d0501
commit 85b69bde15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 27 deletions

View File

@ -8,6 +8,7 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/copy_and_p
import 'package:appflowy/plugins/document/presentation/editor_plugins/toggle/toggle_block_shortcuts.dart';
import 'package:appflowy/workspace/application/settings/shortcuts/settings_shortcuts_cubit.dart';
import 'package:appflowy/workspace/application/settings/shortcuts/settings_shortcuts_service.dart';
import 'package:appflowy/workspace/presentation/home/menu/sidebar/space/shared_widget.dart';
import 'package:appflowy/workspace/presentation/settings/shared/settings_alert_dialog.dart';
import 'package:appflowy/workspace/presentation/settings/shared/settings_body.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/emoji_picker/emoji_shortcut_event.dart';
@ -55,21 +56,24 @@ class _SettingsShortcutsViewState extends State<SettingsShortcutsView> {
),
const HSpace(10),
_ResetButton(
onReset: () => SettingsAlertDialog(
isDangerous: true,
title: LocaleKeys.settings_shortcutsPage_resetDialog_title
.tr(),
subtitle: LocaleKeys
.settings_shortcutsPage_resetDialog_description
.tr(),
confirmLabel: LocaleKeys
.settings_shortcutsPage_resetDialog_buttonLabel
.tr(),
confirm: () {
Navigator.of(context).pop();
context.read<ShortcutsCubit>().resetToDefault();
},
).show(context),
onReset: () {
showConfirmDialog(
context: context,
title: LocaleKeys.settings_shortcutsPage_resetDialog_title
.tr(),
description: LocaleKeys
.settings_shortcutsPage_resetDialog_description
.tr(),
confirmLabel: LocaleKeys
.settings_shortcutsPage_resetDialog_buttonLabel
.tr(),
onConfirm: () {
context.read<ShortcutsCubit>().resetToDefault();
Navigator.of(context).pop();
},
style: ConfirmPopupStyle.cancelAndOk,
);
},
),
],
),

View File

@ -1,12 +1,10 @@
import 'package:flutter/material.dart';
import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/size.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/widget/dialog/styled_dialogs.dart';
import 'package:flutter/material.dart';
class SettingsAlertDialog extends StatefulWidget {
const SettingsAlertDialog({
@ -201,18 +199,16 @@ class _Actions extends StatelessWidget {
children: [
if (!hideCancelButton) ...[
SizedBox(
height: 24,
child: FlowyTextButton(
LocaleKeys.button_cancel.tr(),
padding: const EdgeInsets.symmetric(
height: 48,
child: PrimaryRoundedButton(
text: LocaleKeys.button_cancel.tr(),
margin: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
fontColor: AFThemeExtension.of(context).textColor,
fillColor: Colors.transparent,
hoverColor: Colors.transparent,
radius: Corners.s12Border,
onPressed: () {
fontWeight: FontWeight.w600,
radius: 12.0,
onTap: () {
cancel?.call();
Navigator.of(context).pop();
},