flutter Text截断文字显示不完整

2022-12-02  本文已影响0人  司徒新新

就是加一个不可见的空格
replaceAll('', '\u200b')

代码

Text(
  '${(model?.price ?? '')}'.replaceAll('', '\u200b'),
  style: TextStyle(
    fontSize: SAdapt.size(20),
    color: getBlackColor(),
    fontFamily: getSegoeUIBold(),
    fontWeight: FontWeight.bold,
  ),
  overflow: TextOverflow.ellipsis,
  maxLines: 1,
),
上一篇 下一篇

猜你喜欢

热点阅读