Created
May 1, 2017 14:35
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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