【发布时间】:2022-07-31 17:55:56
【问题描述】:
这就是我想做的设计
这是我目前的设计
我是新来的颤振。我的问题是如何在 textformfield 上方制作文本。我在互联网上搜索并尝试这样做,但仍然没有成功。我不知道还能去哪里解决我的问题。我希望溢出愿意帮助我。
这是我的代码:
Container(
width: double.infinity,
margin: EdgeInsets.fromLTRB(10, 0, 10, 10),
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
border: Border.all(
color: Colors.transparent,
width: 1.0,
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
SizedBox(
height: 100,
width: 100,
child: Text('First Name'),
),
SizedBox(
width: 200,
child: TextFormField(
style: TextStyle(color: Colors.black),
controller: firstName,
onSaved: (String? value) {
firstName.text = value!;
},
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: 'First Name',
hintStyle: TextStyle(
color: Colors.black, fontSize: 16),
),
),
),
],
)
],
),
)
【问题讨论】:
标签: flutter dart flutter-layout