SizedBox(
width: double.infinity,
child: TextField(
decoration: InputDecoration(
hintStyle: TextStyle(height: 12),
isDense: true,
hintText: "Buraya yazın...",
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(10),
),
fillColor: Color(0xFFD8DDE0),
filled: true),
),
),
how can i make this text field anyone can help me?
I tried to adjust the height of the text, but its position is centered, how can I make this text field this time?
CodePudding user response:
use maxlines
properties and remove height from hintstyle
Output :-
Code:-
TextField(
maxLines: 5,
decoration: InputDecoration(
isDense: true,
hintText: "Buraya yazın...",
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(10),
),
fillColor: Color(0xFFD8DDE0),
filled: true),
),
CodePudding user response:
Try below code:
TextField(
textAlignVertical: TextAlignVertical.top,
maxLines: 6,
decoration: InputDecoration(
isDense: true,
hintText: "Buraya yazın...",
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(10),
),
fillColor: Color(0xFFD8DDE0),
filled: true,
),
),
CodePudding user response:
Use textAlign
to align the text at the start and you can use the maxLines
property of TextFormField
to adjust its height.
Code Snipped:
TextFormField(
maxLines: 8,
textAlign: TextAlign.start,
decoration: InputDecoration(
hintText: "Buraya yazın...",
fillColor: const Color(0xFFD8DDE0),
filled: true,
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(15),
),
),
),