Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
'Discount (%) :',
style: TextStyle(fontSize: 14),
),
Container(
width: 40,
height: 30,
decoration: BoxDecoration(
color: Colors.grey.shade200,
border: const Border.fromBorderSide(BorderSide.none),
borderRadius: BorderRadius.circular(10)),
child: Center(
child: TextField(
onChanged: (text) {
getDiscountedAmount(text);
},
cursorHeight: 18,
keyboardType: TextInputType.number,
controller: discountController,
decoration: const InputDecoration(
floatingLabelBehavior: FloatingLabelBehavior.never,
border: InputBorder.none,
contentPadding:
EdgeInsets.only(bottom: 12, right: 2),
labelText: ' 0',
labelStyle: TextStyle(
fontSize: 14,
),
),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 14,
),
),
),
),
],
),
This is how screen looks when keyboard is opened.I有用SingleChildScrollView包装的列.Column包含作为最后一个小部件的TextField.当我点击文本字段时,默认情况下,我的键盘会与文本字段重叠.我看不到文本字段中的输入是什么.即使在键盘打开的情况下,我也希望看到Textfield. 如何在Flutter 翼中做到这一点?请给我带路.先谢谢你.
我希望屏幕滚动起来,文本字段应该是可见的,即使键盘是打开的.