From 91ae074f36017a73b034026bfacc74228b5b0266 Mon Sep 17 00:00:00 2001 From: Dat PHAM HOANG Date: Thu, 5 Dec 2024 17:42:38 +0700 Subject: [PATCH 1/2] Fix Store reject by inappropriate words on buttons --- lib/pages/forward/forward_view_style.dart | 1 - lib/utils/permission_dialog.dart | 2 +- .../contacts_warning_banner_style.dart | 1 - .../contacts_warning_banner_view.dart | 2 +- .../twake_components/twake_text_button.dart | 26 ++++++++----------- .../twake_text_button_style.dart | 17 ++++++++++++ 6 files changed, 30 insertions(+), 19 deletions(-) create mode 100644 lib/widgets/twake_components/twake_text_button_style.dart diff --git a/lib/pages/forward/forward_view_style.dart b/lib/pages/forward/forward_view_style.dart index b0c50db71..b71c09530 100644 --- a/lib/pages/forward/forward_view_style.dart +++ b/lib/pages/forward/forward_view_style.dart @@ -37,7 +37,6 @@ class ForwardViewStyle { static EdgeInsetsDirectional webActionsButtonMargin = const EdgeInsetsDirectional.symmetric( - vertical: 10.0, horizontal: 24.0, ); } diff --git a/lib/utils/permission_dialog.dart b/lib/utils/permission_dialog.dart index 0afc55a7f..75c823cc2 100644 --- a/lib/utils/permission_dialog.dart +++ b/lib/utils/permission_dialog.dart @@ -83,7 +83,7 @@ class _PermissionDialogState extends State ), _PermissionTextButton( context: context, - text: L10n.of(context)!.allow, + text: L10n.of(context)!.next, onPressed: () async { if (widget.onAcceptButton != null) { widget.onAcceptButton!.call(); diff --git a/lib/widgets/contacts_warning_banner/contacts_warning_banner_style.dart b/lib/widgets/contacts_warning_banner/contacts_warning_banner_style.dart index 2e9f28a91..bbccabfe9 100644 --- a/lib/widgets/contacts_warning_banner/contacts_warning_banner_style.dart +++ b/lib/widgets/contacts_warning_banner/contacts_warning_banner_style.dart @@ -15,7 +15,6 @@ class ContactsWarningBannerStyle { static EdgeInsetsDirectional marginButtonWarningBanner = const EdgeInsetsDirectional.symmetric( - vertical: 10.0, horizontal: 24.0, ); diff --git a/lib/widgets/contacts_warning_banner/contacts_warning_banner_view.dart b/lib/widgets/contacts_warning_banner/contacts_warning_banner_view.dart index 85f01850e..595b56dcd 100644 --- a/lib/widgets/contacts_warning_banner/contacts_warning_banner_view.dart +++ b/lib/widgets/contacts_warning_banner/contacts_warning_banner_view.dart @@ -67,7 +67,7 @@ class ContactsWarningBannerView extends StatelessWidget { ), ), TwakeTextButton( - message: L10n.of(context)!.allow, + message: L10n.of(context)!.next, borderHover: ContactsWarningBannerStyle .borderHoverButtonWaningBanner, onTap: goToSettingsForPermissionActions, diff --git a/lib/widgets/twake_components/twake_text_button.dart b/lib/widgets/twake_components/twake_text_button.dart index ea4dc2e64..5f479a9f5 100644 --- a/lib/widgets/twake_components/twake_text_button.dart +++ b/lib/widgets/twake_components/twake_text_button.dart @@ -1,4 +1,5 @@ import 'package:fluffychat/widgets/twake_components/twake_icon_button.dart'; +import 'package:fluffychat/widgets/twake_components/twake_text_button_style.dart'; import 'package:flutter/material.dart'; import 'package:linagora_design_flutter/linagora_design_flutter.dart'; @@ -11,8 +12,6 @@ class TwakeTextButton extends StatelessWidget { final TextStyle? styleMessage; - final double? paddingAll; - final double? size; final double? fill; @@ -36,7 +35,6 @@ class TwakeTextButton extends StatelessWidget { required this.message, this.styleMessage, this.onTap, - this.paddingAll, this.size, this.fill, this.weight, @@ -57,11 +55,12 @@ class TwakeTextButton extends StatelessWidget { child: InkWell( onTap: onTap, onTapDown: (tapDownDetails) => onTapDown?.call(tapDownDetails), - radius: paddingAll, hoverColor: hoverColor, borderRadius: BorderRadius.circular(borderHover ?? 0), child: Container( - constraints: constraints, + constraints: constraints ?? BoxConstraints( + maxWidth: TwakeTextButtonStyle.getBoxConstraintMaxWidth(context), + ), height: 48, padding: margin, decoration: @@ -70,16 +69,13 @@ class TwakeTextButton extends StatelessWidget { 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, - ), - overflow: TextOverflow.ellipsis, - ), + child: Text( + message, + style: styleMessage ?? + Theme.of(context).textTheme.labelLarge?.copyWith( + color: LinagoraSysColors.material().onPrimary, + ), + overflow: TextOverflow.ellipsis, ), ), ), diff --git a/lib/widgets/twake_components/twake_text_button_style.dart b/lib/widgets/twake_components/twake_text_button_style.dart new file mode 100644 index 000000000..81282edbe --- /dev/null +++ b/lib/widgets/twake_components/twake_text_button_style.dart @@ -0,0 +1,17 @@ +import 'package:fluffychat/di/global/get_it_initializer.dart'; +import 'package:fluffychat/utils/responsive/responsive_utils.dart'; +import 'package:flutter/material.dart'; + +class TwakeTextButtonStyle { + static final ResponsiveUtils _responsiveUtils = getIt.get(); + + static const double maxWidthDialogButtonMobile = 112; + + static const double maxWidthDialogButtonWeb = 128; + + static double getBoxConstraintMaxWidth(BuildContext context) { + return _responsiveUtils.isMobile(context) + ? maxWidthDialogButtonMobile + : maxWidthDialogButtonWeb; + } +} From fbfe763eaebf214f95a372512c06eb0cd06ab880 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Thu, 5 Dec 2024 18:11:35 +0700 Subject: [PATCH 2/2] fixup! Fix Store reject by inappropriate words on buttons --- lib/widgets/twake_components/twake_text_button.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/widgets/twake_components/twake_text_button.dart b/lib/widgets/twake_components/twake_text_button.dart index 5f479a9f5..796881c81 100644 --- a/lib/widgets/twake_components/twake_text_button.dart +++ b/lib/widgets/twake_components/twake_text_button.dart @@ -58,9 +58,11 @@ class TwakeTextButton extends StatelessWidget { hoverColor: hoverColor, borderRadius: BorderRadius.circular(borderHover ?? 0), child: Container( - constraints: constraints ?? BoxConstraints( - maxWidth: TwakeTextButtonStyle.getBoxConstraintMaxWidth(context), - ), + constraints: constraints ?? + BoxConstraints( + maxWidth: + TwakeTextButtonStyle.getBoxConstraintMaxWidth(context), + ), height: 48, padding: margin, decoration: