美文网首页
flutter Text截断文字显示不完整

flutter Text截断文字显示不完整

作者: 司徒新新 | 来源:发表于2022-12-02 10:25 被阅读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,
),

相关文章

网友评论

      本文标题:flutter Text截断文字显示不完整

      本文链接:https://www.haomeiwen.com/subject/qwtufdtx.html