Scroll to textfield on focus
This commit is contained in:
@@ -22,6 +22,7 @@ class RegistrationScreen extends BaseScreen {
|
||||
class RegistrationScreenState extends BaseState<RegistrationScreen> {
|
||||
|
||||
RegistrationScreenState(SqliteHelper helper, String app) : super(helper, app);
|
||||
FocusNode _focusNode = new FocusNode();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext ctx) {
|
||||
@@ -54,12 +55,15 @@ class RegistrationScreenState extends BaseState<RegistrationScreen> {
|
||||
|
||||
@override
|
||||
getTextWidget() {
|
||||
return new TextField(
|
||||
return new EnsureVisibleWhenFocused(
|
||||
focusNode: _focusNode,
|
||||
child: new TextField(
|
||||
focusNode: _focusNode,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: new InputDecoration.collapsed(
|
||||
hintText: getHintString(),
|
||||
hintStyle: new TextStyle(color: greyTextColor, fontSize: 16.0)),
|
||||
onChanged: (text) => handleUserInput(text));
|
||||
onChanged: (text) => handleUserInput(text)));
|
||||
}
|
||||
|
||||
/// Возвращает кнопку регистрации.
|
||||
|
||||
Reference in New Issue
Block a user