From e788c716027c49f7cd5deffdf099318e607a1546 Mon Sep 17 00:00:00 2001 From: Richard Shiue <71320345+richardshiue@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:41:25 +0800 Subject: [PATCH] fix: padding issue with the select tags (#3929) * fix: padding issue with the select tags * chore: better solution from Lucas --- .../row/cells/select_option_cell/extension.dart | 6 ++---- .../flowy_infra_ui/lib/style_widget/text.dart | 12 ++++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/cells/select_option_cell/extension.dart b/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/cells/select_option_cell/extension.dart index 5b4ec4f037..7f5b508fca 100644 --- a/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/cells/select_option_cell/extension.dart +++ b/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/cells/select_option_cell/extension.dart @@ -3,10 +3,8 @@ import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart' import 'package:flowy_infra/theme_extension.dart'; import 'package:flowy_infra/size.dart'; +import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/style_widget/hover.dart'; -import 'package:flowy_infra_ui/style_widget/icon_button.dart'; -import 'package:flowy_infra_ui/style_widget/text.dart'; -import 'package:flowy_infra_ui/widget/spacing.dart'; import 'package:flutter/material.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:appflowy/generated/locale_keys.g.dart'; @@ -93,7 +91,7 @@ class SelectOptionTag extends StatelessWidget { @override Widget build(BuildContext context) { EdgeInsets padding = - const EdgeInsets.symmetric(vertical: 1.5, horizontal: 8.0); + const EdgeInsets.symmetric(vertical: 2, horizontal: 8.0); if (onRemove != null) { padding = padding.copyWith(right: 2.0); } diff --git a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/text.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/text.dart index 849538a36b..35d8029841 100644 --- a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/text.dart +++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/text.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; class FlowyText extends StatelessWidget { @@ -89,10 +91,12 @@ class FlowyText extends StatelessWidget { maxLines: maxLines, textAlign: textAlign, overflow: overflow ?? TextOverflow.clip, - textHeightBehavior: const TextHeightBehavior( - applyHeightToFirstAscent: false, - applyHeightToLastDescent: false, - ), + textHeightBehavior: Platform.isAndroid || Platform.isIOS + ? const TextHeightBehavior( + applyHeightToFirstAscent: false, + applyHeightToLastDescent: false, + ) + : null, style: Theme.of(context).textTheme.bodyMedium!.copyWith( fontSize: fontSize, fontWeight: fontWeight,