我刚开始学习Flutter。我目前正在尝试让一个Text小部件在一行中两个容器之间溢出。
以下是代码:
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
color: Colors.green,
width: 100.273,
height: 150,
child: const Text(
"Test",
overflow: TextOverflow.visible,
style: TextStyle(
color: Colors.black,
decoration: TextDecoration.none,
),
),
),
Container(
color: Colors.white,
width: 100,
height: 150,
),
],
),
我尝试使用不同的小部件来培养容器,并尝试了不同的TextOverflow值。Visible和Clip似乎没有起作用。我尝试将Text小部件移到行上,并使其通过两个容器进行裁剪,但也没有成功。
这是当前的布局,我希望绿色容器中的“test”能够裁剪到白色容器中。
[
![image](https://istack.dev59.com/ntF3L.webp)