hide keypad flutter code example
Example 1: flutter trigger show off keyboard
FocusScope.of(context).unfocus()
Example 2: how i can close keyboard in flutter
class YourPage extends StatefulWidget {
createState() => _YourPageState();
}
class _YourPageState extends State {
FocusNode focusNode = new FocusNode();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
TextField(
focusNode: focusNode,
),
SizedBox(height: 10,),
RaisedButton(child: Text("UP"),onPressed: (){
FocusScope.of(context).requestFocus(focusNode);
},),
SizedBox(height: 10,),
RaisedButton(child: Text("DOWN"),onPressed: (){
focusNode.unfocus();
},),
],
)
);
}
}