Reputation: 1608
I want to achieve an layout in flutter in which first textfield is of defined height let suppose 16, and second textfield should cover all remaining space just like shown in the picture
Now I have achieved this layout by wrapping textfield in expanded and giving it height of the screen and because of expanded widget it won't overflow. I know this is the bad approach but problem is when I start writing in textfield it starts writing on the bottom of textfield. Now if it is textfield or other widget in the picture which hint text is What's it for?. All in all how can I achieve this type of layout
Upvotes: 0
Views: 297
Reputation: 1762
Would you mind try
Scaffold(
appBar: AppBar(
title: Text("Test"),
),
body: Column(
children: [
Container(height: 16, child: TextField()),
Expanded(
child: TextField(
expands: true,
minLines: null,
maxLines: null,
decoration: new InputDecoration(hintText: "What's it for?"),
))
],
)
Upvotes: 1