Skip to content

Commit

Permalink
Fix Store reject by inappropriate words on buttons (#2174)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangdat authored Dec 6, 2024
1 parent 122a0b2 commit 3a53be8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 19 deletions.
1 change: 0 additions & 1 deletion lib/pages/forward/forward_view_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class ForwardViewStyle {

static EdgeInsetsDirectional webActionsButtonMargin =
const EdgeInsetsDirectional.symmetric(
vertical: 10.0,
horizontal: 24.0,
);
}
2 changes: 1 addition & 1 deletion lib/utils/permission_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class _PermissionDialogState extends State<PermissionDialog>
),
_PermissionTextButton(
context: context,
text: L10n.of(context)!.allow,
text: L10n.of(context)!.next,
onPressed: () async {
if (widget.onAcceptButton != null) {
widget.onAcceptButton!.call();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class ContactsWarningBannerStyle {

static EdgeInsetsDirectional marginButtonWarningBanner =
const EdgeInsetsDirectional.symmetric(
vertical: 10.0,
horizontal: 24.0,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ContactsWarningBannerView extends StatelessWidget {
),
),
TwakeTextButton(
message: L10n.of(context)!.allow,
message: L10n.of(context)!.next,
borderHover: ContactsWarningBannerStyle
.borderHoverButtonWaningBanner,
onTap: goToSettingsForPermissionActions,
Expand Down
28 changes: 13 additions & 15 deletions lib/widgets/twake_components/twake_text_button.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -11,8 +12,6 @@ class TwakeTextButton extends StatelessWidget {

final TextStyle? styleMessage;

final double? paddingAll;

final double? size;

final double? fill;
Expand All @@ -36,7 +35,6 @@ class TwakeTextButton extends StatelessWidget {
required this.message,
this.styleMessage,
this.onTap,
this.paddingAll,
this.size,
this.fill,
this.weight,
Expand All @@ -57,11 +55,14 @@ 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:
Expand All @@ -70,16 +71,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,
),
),
),
Expand Down
17 changes: 17 additions & 0 deletions lib/widgets/twake_components/twake_text_button_style.dart
Original file line number Diff line number Diff line change
@@ -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<ResponsiveUtils>();

static const double maxWidthDialogButtonMobile = 112;

static const double maxWidthDialogButtonWeb = 128;

static double getBoxConstraintMaxWidth(BuildContext context) {
return _responsiveUtils.isMobile(context)
? maxWidthDialogButtonMobile
: maxWidthDialogButtonWeb;
}
}

0 comments on commit 3a53be8

Please sign in to comment.