您可以使用Stack
堆叠TextField
到线上。您需要设置expands
的属性TextField
设置为 true 以便使其从一开始就扩展到完整的三行宽度。
我实现了类似的TextField
到您正在尝试创建的:
Stack(
children: [
for (int i = 0; i < 3; i++)
Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 4 + (i + 1) * 28,
left: 15,
right: 15,
),
height: 1,
color: Colors.black,
),
const SizedBox(
height: 97,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 15),
child: TextField(
decoration: InputDecoration(border: InputBorder.none),
cursorHeight: 22,
style: TextStyle(
fontSize: 20.0,
),
keyboardType: TextInputType.multiline,
expands: true,
maxLines: null,
),
),
),
],
),
Result: