From 5b8fb89ebb96bca9f70cf0181ee544fcf0743d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=B9i=20Trung=20Hi=E1=BA=BFu?= Date: Thu, 18 Jul 2024 11:59:20 +0700 Subject: [PATCH 1/6] TW-1942: Add new confirm dialog --- lib/utils/dialog/twake_dialog.dart | 181 +++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) diff --git a/lib/utils/dialog/twake_dialog.dart b/lib/utils/dialog/twake_dialog.dart index d199788d57..7c5601341c 100644 --- a/lib/utils/dialog/twake_dialog.dart +++ b/lib/utils/dialog/twake_dialog.dart @@ -1,8 +1,12 @@ import 'dart:async'; +import 'package:animations/animations.dart'; import 'package:fluffychat/pages/bootstrap/init_client_dialog.dart'; import 'package:fluffychat/resource/image_paths.dart'; import 'package:fluffychat/utils/platform_infos.dart'; +import 'package:fluffychat/utils/responsive/responsive_utils.dart'; import 'package:fluffychat/widgets/twake_app.dart'; +import 'package:fluffychat/widgets/twake_components/twake_icon_button.dart'; +import 'package:fluffychat/widgets/twake_components/twake_text_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:future_loading_dialog/future_loading_dialog.dart'; @@ -227,3 +231,180 @@ class ProgressDialog extends StatelessWidget { ); } } + +enum ConfirmResult { + ok, + cancel, +} + +Future showConfirmAlertDialog({ + required BuildContext context, + required ResponsiveUtils responsiveUtils, + bool useRootNavigator = true, + bool barrierDismissible = true, + bool isDestructiveAction = false, + String? title, + String? message, + String? okLabel, + String? cancelLabel, + void Function()? onClose, +}) async { + final result = await showModal( + context: context, + configuration: FadeScaleTransitionConfiguration( + barrierDismissible: barrierDismissible, + ), + useRootNavigator: useRootNavigator, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.of(context).pop(ConfirmResult.cancel), + child: Material( + type: MaterialType.transparency, + child: Container( + height: double.infinity, + width: double.infinity, + color: Colors.transparent, + child: Center( + child: Container( + constraints: BoxConstraints( + maxWidth: responsiveUtils.isMobile(context) + ? responsiveUtils.getSizeScreenWidth(context) - 48 + : 448, + ), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surface, + borderRadius: const BorderRadius.all(Radius.circular(16)), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.15), + blurRadius: 8, + offset: const Offset(0, 4), + spreadRadius: 3, + ), + BoxShadow( + color: Colors.black.withOpacity(0.3), + blurRadius: 3, + offset: const Offset(0, 1), + ), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Align( + alignment: Alignment.topRight, + child: TwakeIconButton( + icon: Icons.close, + iconColor: isDestructiveAction + ? CupertinoColors.destructiveRed + : LinagoraSysColors.material().onSurfaceVariant, + onTap: () { + Navigator.of(context).pop(ConfirmResult.cancel); + onClose?.call(); + }, + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (title != null) + Center( + child: Text( + title, + style: Theme.of(context) + .textTheme + .titleLarge + ?.copyWith( + color: LinagoraSysColors.material() + .onSurfaceVariant, + ), + ), + ), + const SizedBox(height: 27), + if (message != null) + Padding( + padding: const EdgeInsets.only(left: 28.0), + child: Text( + message, + style: Theme.of(context) + .textTheme + .titleSmall + ?.copyWith( + color: LinagoraSysColors.material() + .onSurfaceVariant, + ), + ), + ), + const SizedBox(height: 65), + Padding( + padding: const EdgeInsets.only( + right: 20.0, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TwakeTextButton( + message: + cancelLabel ?? L10n.of(context)!.cancel, + styleMessage: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith( + color: Theme.of(context) + .colorScheme + .primary, + ), + hoverColor: Colors.transparent, + onTap: () { + Navigator.of(context) + .pop(ConfirmResult.cancel); + onClose?.call(); + }, + ), + const SizedBox(width: 27), + TwakeTextButton( + buttonDecoration: BoxDecoration( + color: LinagoraSysColors.material().primary, + borderRadius: const BorderRadius.all( + Radius.circular(100), + ), + ), + margin: const EdgeInsetsDirectional.symmetric( + horizontal: 24.0, + vertical: 14.0, + ), + message: okLabel ?? L10n.of(context)!.ok, + styleMessage: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith( + color: LinagoraSysColors.material() + .onPrimary, + ), + hoverColor: Colors.transparent, + onTap: () { + Navigator.of(context).pop(ConfirmResult.ok); + onClose?.call(); + }, + ), + ], + ), + ), + const SizedBox(height: 24.0), + ], + ), + ), + ], + ), + ), + ), + ), + ), + ); + }, + ); + + return result ?? ConfirmResult.cancel; +} From c02bb18d08eef1d247294bbd4631b9c863350ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=B9i=20Trung=20Hi=E1=BA=BFu?= Date: Thu, 18 Jul 2024 11:59:55 +0700 Subject: [PATCH 2/6] TW-1942: Change logout dialog --- assets/l10n/intl_en.arb | 3 ++- lib/pages/settings_dashboard/settings/settings.dart | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index f56c412451..ab3d442989 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -3112,5 +3112,6 @@ "type": "int" } } - } + }, + "logoutDialogWarning": "You will lose access to encrypted messages. We recommend that you enable chat backups before loggingout" } diff --git a/lib/pages/settings_dashboard/settings/settings.dart b/lib/pages/settings_dashboard/settings/settings.dart index 18e3c2534b..4efa0be7e6 100644 --- a/lib/pages/settings_dashboard/settings/settings.dart +++ b/lib/pages/settings_dashboard/settings/settings.dart @@ -10,6 +10,7 @@ import 'package:fluffychat/presentation/enum/settings/settings_enum.dart'; import 'package:fluffychat/presentation/extensions/client_extension.dart'; import 'package:fluffychat/utils/dialog/twake_dialog.dart'; import 'package:fluffychat/utils/platform_infos.dart'; +import 'package:fluffychat/utils/responsive/responsive_utils.dart'; import 'package:fluffychat/utils/url_launcher.dart'; import 'package:fluffychat/widgets/matrix.dart'; import 'package:fluffychat/widgets/twake_app.dart'; @@ -40,6 +41,7 @@ class SettingsController extends State with ConnectPageMixin { final ValueNotifier displayNameNotifier = ValueNotifier(''); final tomConfigurationRepository = getIt.get(); + final _responsiveUtils = getIt.get(); StreamSubscription? onAccountDataSubscription; @@ -69,23 +71,22 @@ class SettingsController extends State with ConnectPageMixin { settingEnum == optionsSelectNotifier.value; void logoutAction() async { - final noBackup = showChatBackupSwitch.value == true; final twakeContext = TwakeApp.routerKey.currentContext; if (twakeContext == null) { Logs().e( 'SettingsController()::logoutAction - Twake context is null', ); } - if (await showOkCancelAlertDialog( + if (await showConfirmAlertDialog( useRootNavigator: false, context: twakeContext!, + responsiveUtils: _responsiveUtils, title: L10n.of(context)!.areYouSureYouWantToLogout, - message: L10n.of(context)!.noBackupWarning, - isDestructiveAction: noBackup, + message: L10n.of(context)!.logoutDialogWarning, okLabel: L10n.of(context)!.logout, cancelLabel: L10n.of(context)!.cancel, ) == - OkCancelResult.cancel) { + ConfirmResult.cancel) { return; } if (PlatformInfos.isMobile) { From 4e443c25c1267a0e6593cc20758118c5c42072f1 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Tue, 15 Oct 2024 13:37:59 +0700 Subject: [PATCH 3/6] fixup! TW-1942: Change logout dialog --- lib/utils/dialog/twake_dialog.dart | 71 +++++++++++++++++++----------- 1 file changed, 45 insertions(+), 26 deletions(-) diff --git a/lib/utils/dialog/twake_dialog.dart b/lib/utils/dialog/twake_dialog.dart index 7c5601341c..5372d25375 100644 --- a/lib/utils/dialog/twake_dialog.dart +++ b/lib/utils/dialog/twake_dialog.dart @@ -291,19 +291,22 @@ Future showConfirmAlertDialog({ child: Column( mainAxisSize: MainAxisSize.min, children: [ - Align( - alignment: Alignment.topRight, - child: TwakeIconButton( - icon: Icons.close, - iconColor: isDestructiveAction - ? CupertinoColors.destructiveRed - : LinagoraSysColors.material().onSurfaceVariant, - onTap: () { - Navigator.of(context).pop(ConfirmResult.cancel); - onClose?.call(); - }, + if (responsiveUtils.isMobile(context)) ...[ + const SizedBox(height: 24), + ] else + Align( + alignment: Alignment.topRight, + child: TwakeIconButton( + icon: Icons.close, + iconColor: isDestructiveAction + ? CupertinoColors.destructiveRed + : LinagoraSysColors.material().onSurfaceVariant, + onTap: () { + Navigator.of(context).pop(ConfirmResult.cancel); + onClose?.call(); + }, + ), ), - ), Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Column( @@ -313,13 +316,21 @@ Future showConfirmAlertDialog({ Center( child: Text( title, - style: Theme.of(context) - .textTheme - .titleLarge - ?.copyWith( - color: LinagoraSysColors.material() - .onSurfaceVariant, - ), + style: responsiveUtils.isMobile(context) + ? Theme.of(context) + .textTheme + .headlineSmall + ?.copyWith( + color: LinagoraSysColors.material() + .onSurfaceVariant, + ) + : Theme.of(context) + .textTheme + .titleLarge + ?.copyWith( + color: LinagoraSysColors.material() + .onSurfaceVariant, + ), ), ), const SizedBox(height: 27), @@ -328,13 +339,21 @@ Future showConfirmAlertDialog({ padding: const EdgeInsets.only(left: 28.0), child: Text( message, - style: Theme.of(context) - .textTheme - .titleSmall - ?.copyWith( - color: LinagoraSysColors.material() - .onSurfaceVariant, - ), + style: responsiveUtils.isMobile(context) + ? Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + color: LinagoraSysColors.material() + .onSurfaceVariant, + ) + : Theme.of(context) + .textTheme + .titleSmall + ?.copyWith( + color: LinagoraSysColors.material() + .onSurfaceVariant, + ), ), ), const SizedBox(height: 65), From f9281bb89aa33b4e8155f37f975c577c59a926d3 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Tue, 15 Oct 2024 22:18:25 +0700 Subject: [PATCH 4/6] fixup! fixup! TW-1942: Change logout dialog --- assets/l10n/intl_en.arb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index ab3d442989..678606d0b9 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -3113,5 +3113,5 @@ } } }, - "logoutDialogWarning": "You will lose access to encrypted messages. We recommend that you enable chat backups before loggingout" + "logoutDialogWarning": "You will lose access to encrypted messages. We recommend that you enable chat backups before logging out" } From fec910bade43fba0c7bdb318595b058200864fd9 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Tue, 15 Oct 2024 22:48:34 +0700 Subject: [PATCH 5/6] fixup! fixup! fixup! TW-1942: Change logout dialog --- lib/utils/dialog/twake_dialog.dart | 199 +++++++++--------- .../twake_components/twake_text_button.dart | 25 ++- 2 files changed, 110 insertions(+), 114 deletions(-) diff --git a/lib/utils/dialog/twake_dialog.dart b/lib/utils/dialog/twake_dialog.dart index 5372d25375..473d396f21 100644 --- a/lib/utils/dialog/twake_dialog.dart +++ b/lib/utils/dialog/twake_dialog.dart @@ -266,10 +266,11 @@ Future showConfirmAlertDialog({ color: Colors.transparent, child: Center( child: Container( - constraints: BoxConstraints( - maxWidth: responsiveUtils.isMobile(context) - ? responsiveUtils.getSizeScreenWidth(context) - 48 - : 448, + margin: EdgeInsets.symmetric( + horizontal: responsiveUtils.isMobile(context) ? 24.0 : 36, + ), + padding: EdgeInsets.symmetric( + horizontal: responsiveUtils.isMobile(context) ? 24.0 : 36, ), decoration: BoxDecoration( color: Theme.of(context).colorScheme.surface, @@ -307,113 +308,105 @@ Future showConfirmAlertDialog({ }, ), ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - if (title != null) - Center( - child: Text( - title, - style: responsiveUtils.isMobile(context) - ? Theme.of(context) - .textTheme - .headlineSmall - ?.copyWith( - color: LinagoraSysColors.material() - .onSurfaceVariant, - ) - : Theme.of(context) - .textTheme - .titleLarge - ?.copyWith( - color: LinagoraSysColors.material() - .onSurfaceVariant, - ), - ), - ), - const SizedBox(height: 27), - if (message != null) - Padding( - padding: const EdgeInsets.only(left: 28.0), - child: Text( - message, - style: responsiveUtils.isMobile(context) - ? Theme.of(context) - .textTheme - .bodyMedium - ?.copyWith( - color: LinagoraSysColors.material() - .onSurfaceVariant, - ) - : Theme.of(context) - .textTheme - .titleSmall - ?.copyWith( - color: LinagoraSysColors.material() - .onSurfaceVariant, - ), - ), - ), - const SizedBox(height: 65), - Padding( - padding: const EdgeInsets.only( - right: 20.0, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TwakeTextButton( - message: - cancelLabel ?? L10n.of(context)!.cancel, - styleMessage: Theme.of(context) + Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (title != null) + Center( + child: Text( + title, + style: responsiveUtils.isMobile(context) + ? Theme.of(context) .textTheme - .labelLarge + .headlineSmall ?.copyWith( - color: Theme.of(context) - .colorScheme - .primary, - ), - hoverColor: Colors.transparent, - onTap: () { - Navigator.of(context) - .pop(ConfirmResult.cancel); - onClose?.call(); - }, - ), - const SizedBox(width: 27), - TwakeTextButton( - buttonDecoration: BoxDecoration( - color: LinagoraSysColors.material().primary, - borderRadius: const BorderRadius.all( - Radius.circular(100), - ), - ), - margin: const EdgeInsetsDirectional.symmetric( - horizontal: 24.0, - vertical: 14.0, - ), - message: okLabel ?? L10n.of(context)!.ok, - styleMessage: Theme.of(context) + color: LinagoraSysColors.material() + .onSurfaceVariant, + ) + : Theme.of(context) .textTheme - .labelLarge + .titleLarge ?.copyWith( color: LinagoraSysColors.material() - .onPrimary, + .onSurfaceVariant, ), - hoverColor: Colors.transparent, - onTap: () { - Navigator.of(context).pop(ConfirmResult.ok); - onClose?.call(); - }, - ), - ], ), ), - const SizedBox(height: 24.0), - ], - ), + SizedBox( + height: responsiveUtils.isMobile(context) ? 16 : 27, + ), + if (message != null) + Text( + message, + style: responsiveUtils.isMobile(context) + ? Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + color: LinagoraSysColors.material() + .onSurfaceVariant, + ) + : Theme.of(context) + .textTheme + .titleSmall + ?.copyWith( + color: LinagoraSysColors.material() + .onSurfaceVariant, + ), + ), + SizedBox( + height: responsiveUtils.isMobile(context) ? 24 : 65, + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TwakeTextButton( + margin: const EdgeInsetsDirectional.symmetric( + horizontal: 24.0, + ), + message: cancelLabel ?? L10n.of(context)!.cancel, + styleMessage: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith( + color: + Theme.of(context).colorScheme.primary, + ), + hoverColor: Colors.transparent, + onTap: () { + Navigator.of(context).pop(ConfirmResult.cancel); + onClose?.call(); + }, + ), + const SizedBox(width: 8), + TwakeTextButton( + buttonDecoration: BoxDecoration( + color: LinagoraSysColors.material().primary, + borderRadius: const BorderRadius.all( + Radius.circular(100), + ), + ), + margin: const EdgeInsetsDirectional.symmetric( + horizontal: 24.0, + ), + message: okLabel ?? L10n.of(context)!.ok, + styleMessage: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith( + color: + LinagoraSysColors.material().onPrimary, + ), + hoverColor: Colors.transparent, + onTap: () { + Navigator.of(context).pop(ConfirmResult.ok); + onClose?.call(); + }, + ), + ], + ), + const SizedBox(height: 24.0), + ], ), ], ), diff --git a/lib/widgets/twake_components/twake_text_button.dart b/lib/widgets/twake_components/twake_text_button.dart index 70eeec604d..f76054bf4d 100644 --- a/lib/widgets/twake_components/twake_text_button.dart +++ b/lib/widgets/twake_components/twake_text_button.dart @@ -58,20 +58,23 @@ class TwakeTextButton extends StatelessWidget { hoverColor: hoverColor, borderRadius: BorderRadius.circular(borderHover ?? 0), child: Container( + height: 48, padding: margin, decoration: buttonDecoration ?? const BoxDecoration(shape: BoxShape.circle), - child: Tooltip( - preferBelow: preferBelow, - message: message, - child: Padding( - padding: EdgeInsets.all(paddingAll ?? 8.0), - child: Text( - message, - style: styleMessage ?? - Theme.of(context).textTheme.labelLarge?.copyWith( - color: LinagoraSysColors.material().onPrimary, - ), + child: Center( + child: Tooltip( + preferBelow: preferBelow, + message: message, + child: Padding( + padding: EdgeInsets.all(paddingAll ?? 8.0), + child: Text( + message, + style: styleMessage ?? + Theme.of(context).textTheme.labelLarge?.copyWith( + color: LinagoraSysColors.material().onPrimary, + ), + ), ), ), ), From 89ad4aa7cd43af77d70beeabfbe400768a145170 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Tue, 15 Oct 2024 23:07:08 +0700 Subject: [PATCH 6/6] fixup! fixup! fixup! fixup! TW-1942: Change logout dialog --- lib/utils/dialog/twake_dialog.dart | 191 ++++++++++++++++------------- 1 file changed, 103 insertions(+), 88 deletions(-) diff --git a/lib/utils/dialog/twake_dialog.dart b/lib/utils/dialog/twake_dialog.dart index 473d396f21..39c75d05da 100644 --- a/lib/utils/dialog/twake_dialog.dart +++ b/lib/utils/dialog/twake_dialog.dart @@ -266,12 +266,11 @@ Future showConfirmAlertDialog({ color: Colors.transparent, child: Center( child: Container( + width: + responsiveUtils.isMobile(context) ? double.infinity : 448, margin: EdgeInsets.symmetric( horizontal: responsiveUtils.isMobile(context) ? 24.0 : 36, ), - padding: EdgeInsets.symmetric( - horizontal: responsiveUtils.isMobile(context) ? 24.0 : 36, - ), decoration: BoxDecoration( color: Theme.of(context).colorScheme.surface, borderRadius: const BorderRadius.all(Radius.circular(16)), @@ -295,25 +294,36 @@ Future showConfirmAlertDialog({ if (responsiveUtils.isMobile(context)) ...[ const SizedBox(height: 24), ] else - Align( - alignment: Alignment.topRight, - child: TwakeIconButton( - icon: Icons.close, - iconColor: isDestructiveAction - ? CupertinoColors.destructiveRed - : LinagoraSysColors.material().onSurfaceVariant, - onTap: () { - Navigator.of(context).pop(ConfirmResult.cancel); - onClose?.call(); - }, + Padding( + padding: const EdgeInsets.only( + top: 8, + right: 8, + ), + child: Align( + alignment: Alignment.topRight, + child: TwakeIconButton( + icon: Icons.close, + iconColor: isDestructiveAction + ? CupertinoColors.destructiveRed + : LinagoraSysColors.material().onSurfaceVariant, + onTap: () { + Navigator.of(context).pop(ConfirmResult.cancel); + onClose?.call(); + }, + ), ), ), - Column( - mainAxisSize: MainAxisSize.min, - children: [ - if (title != null) - Center( - child: Text( + Padding( + padding: EdgeInsets.symmetric( + horizontal: + responsiveUtils.isMobile(context) ? 24.0 : 36, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (title != null) + Text( title, style: responsiveUtils.isMobile(context) ? Theme.of(context) @@ -331,82 +341,87 @@ Future showConfirmAlertDialog({ .onSurfaceVariant, ), ), + SizedBox( + height: responsiveUtils.isMobile(context) ? 16 : 27, ), - SizedBox( - height: responsiveUtils.isMobile(context) ? 16 : 27, - ), - if (message != null) - Text( - message, - style: responsiveUtils.isMobile(context) - ? Theme.of(context) - .textTheme - .bodyMedium - ?.copyWith( - color: LinagoraSysColors.material() - .onSurfaceVariant, - ) - : Theme.of(context) + if (message != null) + Text( + message, + style: responsiveUtils.isMobile(context) + ? Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + color: LinagoraSysColors.material() + .onSurfaceVariant, + ) + : Theme.of(context) + .textTheme + .titleSmall + ?.copyWith( + color: LinagoraSysColors.material() + .onSurfaceVariant, + ), + ), + SizedBox( + height: responsiveUtils.isMobile(context) ? 24 : 65, + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TwakeTextButton( + margin: const EdgeInsetsDirectional.symmetric( + horizontal: 24.0, + ), + message: + cancelLabel ?? L10n.of(context)!.cancel, + styleMessage: Theme.of(context) .textTheme - .titleSmall + .labelLarge ?.copyWith( - color: LinagoraSysColors.material() - .onSurfaceVariant, + color: + Theme.of(context).colorScheme.primary, ), - ), - SizedBox( - height: responsiveUtils.isMobile(context) ? 24 : 65, - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TwakeTextButton( - margin: const EdgeInsetsDirectional.symmetric( - horizontal: 24.0, + hoverColor: Colors.transparent, + onTap: () { + Navigator.of(context) + .pop(ConfirmResult.cancel); + onClose?.call(); + }, ), - message: cancelLabel ?? L10n.of(context)!.cancel, - styleMessage: Theme.of(context) - .textTheme - .labelLarge - ?.copyWith( - color: - Theme.of(context).colorScheme.primary, + const SizedBox(width: 8), + TwakeTextButton( + buttonDecoration: BoxDecoration( + color: LinagoraSysColors.material().primary, + borderRadius: const BorderRadius.all( + Radius.circular(100), ), - hoverColor: Colors.transparent, - onTap: () { - Navigator.of(context).pop(ConfirmResult.cancel); - onClose?.call(); - }, - ), - const SizedBox(width: 8), - TwakeTextButton( - buttonDecoration: BoxDecoration( - color: LinagoraSysColors.material().primary, - borderRadius: const BorderRadius.all( - Radius.circular(100), ), + margin: const EdgeInsetsDirectional.symmetric( + horizontal: 24.0, + ), + message: okLabel ?? L10n.of(context)!.ok, + styleMessage: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith( + color: LinagoraSysColors.material() + .onPrimary, + ), + hoverColor: Colors.transparent, + onTap: () { + Navigator.of(context).pop(ConfirmResult.ok); + onClose?.call(); + }, ), - margin: const EdgeInsetsDirectional.symmetric( - horizontal: 24.0, - ), - message: okLabel ?? L10n.of(context)!.ok, - styleMessage: Theme.of(context) - .textTheme - .labelLarge - ?.copyWith( - color: - LinagoraSysColors.material().onPrimary, - ), - hoverColor: Colors.transparent, - onTap: () { - Navigator.of(context).pop(ConfirmResult.ok); - onClose?.call(); - }, - ), - ], - ), - const SizedBox(height: 24.0), - ], + ], + ), + SizedBox( + height: + responsiveUtils.isMobile(context) ? 24.0 : 36, + ), + ], + ), ), ], ),