我正在使用带有FocusNode的SingleChildScrollview中的TextFormField,并且效果很好。
TextFormField(
focusNode: _focusNode,
textInputAction: TextInputAction.next,
onFieldSubmitted: (term) {
_focusNode.unfocus();
FocusScope.of(context).requestFocus(_focusNodeNext);
},
controller: myController,
keyboardType: TextInputType.number,
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: ScopedModelLocalizations().tags,
labelText: ScopedModelLocalizations().entertags,
fillColor: Colors.white
),
validator: (value) {
if (value.isNotEmpty && !isNumeric(trim(value))) {
return ScopedModelLocalizations().validnumber;
}
},
)
由于InputDecoration,当它成为焦点时,它看起来像这样:
理想情况下,我会这样:
有没有一种方法可以为某个字段甚至整个堆栈调整焦点滚动位置的偏移量?