Hey how do I dismiss the keyboard here? I want the keyboard to dismiss when tapped outside the area.
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
child: TextFormField(
keyboardType: TextInputType.number,
maxLength: 10,
controller: widget._phoneController,
onTap: () => FocusScope.of(context).unfocus(),
inputFormatters: [
//input type
FilteringTextInputFormatter.allow(
RegExp(r'[0-9]'),
),
],
//how the text box is decorated
decoration: buildInputDecoration(
Icons.phone, 'Enter your 10 digit phone number'),
),
);
}