Untuk menyesuaikan lebar, Anda bisa membungkus TextField
Anda dengan widget Container
, seperti ini.
Container(
width: 100.0,
child: TextField()
)
Tapi saya tidak begitu yakin dengan yang Anda maksud tentang ketinggian TextField, jadi saya coba tambahkan cara lain menggunakan widget TextStyle, barangkali Anda membutuhkan cara ini juga, dengan begitu Anda dapat memanipulasi fontSize dan/atau tinggi.
Container(
width: 100.0,
child: TextField(
style: TextStyle(
fontSize: 40.0,
height: 2.0,
color: Colors.black
)
)
)
Perhatikan bahwa tinggi dalam TextStyle adalah pengganda dari ukuran font, sesuai dengan komentar pada properti itu sendiri.
The height of this text span, as a multiple of the font size.
When [height] is null or omitted, the line height will be determined by the font's metrics directly, which may differ from the fontSize. When [height] is non-null, the line height of the span of text will be a multiple of [fontSize] and be exactly fontSize * height logical pixels tall.
Terakhir tapi bukan akhir segalanya, Anda mungkin ingin melihat properti dekorasi TextField
Anda, yang memberi Anda banyak kemungkinan.
TextField(
decoration: const InputDecoration(
contentPadding: const EdgeInsets.symmetric(vertical: 40.0),
)
)