TF-691 Set overflow default for text is too long on web

This commit is contained in:
dab246
2022-08-04 11:46:13 +07:00
committed by Dat H. Pham
parent 546627b9df
commit 837d058ecb
15 changed files with 56 additions and 8 deletions
@@ -12,4 +12,6 @@ class CommonTextStyle {
static final defaultTextOverFlow = BuildUtils.isWeb
? TextOverflow.fade
: TextOverflow.ellipsis;
static final defaultSoftWrap = BuildUtils.isWeb ? false : true;
}
@@ -150,6 +150,7 @@ class ButtonBuilder {
return Text(
'${_text ?? ''}',
maxLines: 1,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: CommonTextStyle.defaultTextOverFlow,
style: _textStyle ?? TextStyle(fontSize: 12, color: AppColor.colorTextButton),
);
@@ -1,3 +1,4 @@
import 'package:core/presentation/utils/style_utils.dart';
import 'package:flutter/material.dart';
class RichTextBuilder {
@@ -34,7 +35,8 @@ class RichTextBuilder {
return RichText(
key: _key,
maxLines: _maxLines ?? 1,
overflow: _overflow ?? TextOverflow.ellipsis,
softWrap: CommonTextStyle.defaultSoftWrap,
overflow: _overflow ?? CommonTextStyle.defaultTextOverFlow,
text: TextSpan(
style: _styleOrigin,
children: _getSpans(_textOrigin, _wordToStyle, _styleWord)));