标签: fitted-box

颤振中最多有两行的 fitbox

Container(
      child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 60),
        child: Text(
          //  subCategoryName,
          "This is a very Long Text takes more space",
          textAlign: TextAlign.center,
          maxLines: 2,
          overflow: TextOverflow.fade,
          style: Theme.of(context)
              .textTheme
              .headline3
              .copyWith(color: Colors.white, fontSize: 32),
        ),
      ),
    ),
Run Code Online (Sandbox Code Playgroud)

看这张图

我需要这条线最多为两行,如果文本变得更长,则像 FittedBox(使用 BoxFit.fitWidth)一样缩小尺寸

当我使用 FittedBox 时,它看起来像这样。但如果需要的话,我需要将其增加到 2 行。任何解决方案都会受到赞赏

flutter fitted-box

9
推荐指数
1
解决办法
6223
查看次数

标签 统计

fitted-box ×1

flutter ×1