Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

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

Morn85b69bde1518
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart
index 87ea9d9260..f98ff00a3a 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart
@@ -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,
+ );
+ },
),
],
),
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/shared/settings_alert_dialog.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/shared/settings_alert_dialog.dart
index 61a29b77a1..c56b46eae0 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/shared/settings_alert_dialog.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/shared/settings_alert_dialog.dart
@@ -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();
},