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 行。任何解决方案都会受到赞赏