Skip to content

Instantly share code, notes, and snippets.

@raju-bitter
Created May 1, 2017 14:35
Show Gist options
  • Select an option

  • Save raju-bitter/c823dee4bafb6a9886a6b41e8fbe8ab2 to your computer and use it in GitHub Desktop.

Select an option

Save raju-bitter/c823dee4bafb6a9886a6b41e8fbe8ab2 to your computer and use it in GitHub Desktop.
Flutter Keyboard focus bug: Keyboard will automatically hide when input is covered by keyboard
import 'package:flutter/material.dart';
class FocusKeyboardHidingDemo extends StatefulWidget {
@override
_FocusVisibilityDemoState createState() => new _FocusVisibilityDemoState();
}
class _FocusVisibilityDemoState extends State<FocusKeyboardHidingDemo> {
ScrollController _scrollController = new ScrollController();
@override
Widget build(BuildContext context) {
return new Scaffold(
resizeToAvoidBottomPadding: true,
appBar: new AppBar(title: new Text('Keyboard visibility / focus')),
body: new Form(
child: new ListView(
children: new List.generate(10, (index) {
return new TextFormField(
);
}).toList(),
),
),
);
}
}
void main() {
runApp(new MaterialApp(home: new FocusKeyboardHidingDemo()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment