Tap outside to close virtual kb

This commit is contained in:
Hanh 2021-09-25 23:37:26 +08:00
parent c1680e1e64
commit 91cc0acace
3 changed files with 48 additions and 35 deletions

View File

@ -121,7 +121,10 @@ class PayRecipientState extends State<PayRecipient> {
@override
Widget build(BuildContext context) {
return Form(
return GestureDetector(
onTap: () {
FocusScope.of(context).unfocus();
}, child: Form(
key: _formKey,
child: SingleChildScrollView(
child: Column(children: <Widget>[
@ -169,7 +172,7 @@ class PayRecipientState extends State<PayRecipient> {
children: confirmButtons(context, _onAdd,
okLabel: S.of(context).add, okIcon: Icon(MdiIcons.plus)))
]),
));
)));
}
void _onScan() async {

View File

@ -33,23 +33,33 @@ class PaymentURIState extends State<PaymentURIPage> {
return Form(
key: _formKey,
child: SingleChildScrollView(child: Padding(padding: EdgeInsets.all(8),
child:
Column(mainAxisAlignment: MainAxisAlignment.center, children: [
Text(S.of(context).receivePayment, style: Theme.of(context).textTheme.headline5),
child: SingleChildScrollView(
child: GestureDetector(
onTap: () { FocusScope.of(context).unfocus(); },
child: Padding(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(S.of(context).receivePayment,
style: Theme.of(context).textTheme.headline5),
Padding(padding: EdgeInsets.all(8)),
QrImage(
data: qrText, size: qrSize, backgroundColor: Colors.white),
data: qrText,
size: qrSize,
backgroundColor: Colors.white),
Padding(padding: EdgeInsets.all(8)),
TextFormField(
decoration: InputDecoration(labelText: 'Amount Requested'),
decoration:
InputDecoration(labelText: 'Amount Requested'),
controller: _amountController,
keyboardType: TextInputType.number,
inputFormatters: [makeInputFormatter(true)],
validator: _checkAmount,
),
TextFormField(
decoration: InputDecoration(labelText: S.of(context).memo),
decoration:
InputDecoration(labelText: S.of(context).memo),
minLines: 4,
maxLines: null,
keyboardType: TextInputType.multiline,
@ -63,7 +73,7 @@ class PaymentURIState extends State<PaymentURIPage> {
onPressed: _ok,
),
]),
]))));
])))));
}
String? _checkAmount(String? vs) {

View File

@ -75,7 +75,7 @@ class SendState extends State<SendPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(S.of(context).sendCointicker(coin.ticker))),
body: Form(
body: GestureDetector(onTap: () { FocusScope.of(context).unfocus(); }, child: Form(
key: _formKey,
child: SingleChildScrollView(
padding: EdgeInsets.all(20),
@ -196,7 +196,7 @@ class SendState extends State<SendPage> {
children: confirmButtons(context, _onSend,
okLabel: S.of(context).send,
okIcon: Icon(MdiIcons.send)))
]))));
])))));
}
String? _checkAddress(String? v) {