fix: padding issue with the select tags (#3929)

* fix: padding issue with the select tags

* chore: better solution from Lucas
This commit is contained in:
Richard Shiue 2023-11-13 21:41:25 +08:00 committed by GitHub
parent 7de2131431
commit e788c71602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -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/theme_extension.dart';
import 'package:flowy_infra/size.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/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:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
@ -93,7 +91,7 @@ class SelectOptionTag extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
EdgeInsets padding = EdgeInsets padding =
const EdgeInsets.symmetric(vertical: 1.5, horizontal: 8.0); const EdgeInsets.symmetric(vertical: 2, horizontal: 8.0);
if (onRemove != null) { if (onRemove != null) {
padding = padding.copyWith(right: 2.0); padding = padding.copyWith(right: 2.0);
} }

View File

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class FlowyText extends StatelessWidget { class FlowyText extends StatelessWidget {
@ -89,10 +91,12 @@ class FlowyText extends StatelessWidget {
maxLines: maxLines, maxLines: maxLines,
textAlign: textAlign, textAlign: textAlign,
overflow: overflow ?? TextOverflow.clip, overflow: overflow ?? TextOverflow.clip,
textHeightBehavior: const TextHeightBehavior( textHeightBehavior: Platform.isAndroid || Platform.isIOS
applyHeightToFirstAscent: false, ? const TextHeightBehavior(
applyHeightToLastDescent: false, applyHeightToFirstAscent: false,
), applyHeightToLastDescent: false,
)
: null,
style: Theme.of(context).textTheme.bodyMedium!.copyWith( style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: fontSize, fontSize: fontSize,
fontWeight: fontWeight, fontWeight: fontWeight,