mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +00:00
Merge pull request #238 from cake-tech/CW-18-fix-keyboard-issue-on-the-templates-screen
fix: keyboard jumping over fields in send template
This commit is contained in:
commit
2bbd413b12
1 changed files with 120 additions and 116 deletions
|
@ -34,9 +34,6 @@ class SendTemplatePage extends BasePage {
|
||||||
@override
|
@override
|
||||||
Color get titleColor => Colors.white;
|
Color get titleColor => Colors.white;
|
||||||
|
|
||||||
@override
|
|
||||||
bool get resizeToAvoidBottomInset => false;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool get extendBodyBehindAppBar => true;
|
bool get extendBodyBehindAppBar => true;
|
||||||
|
|
||||||
|
@ -50,8 +47,8 @@ class SendTemplatePage extends BasePage {
|
||||||
return KeyboardActions(
|
return KeyboardActions(
|
||||||
config: KeyboardActionsConfig(
|
config: KeyboardActionsConfig(
|
||||||
keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
|
keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
|
||||||
keyboardBarColor: Theme.of(context).accentTextTheme.body2
|
keyboardBarColor:
|
||||||
.backgroundColor,
|
Theme.of(context).accentTextTheme.body2.backgroundColor,
|
||||||
nextFocus: false,
|
nextFocus: false,
|
||||||
actions: [
|
actions: [
|
||||||
KeyboardActionsItem(
|
KeyboardActionsItem(
|
||||||
|
@ -71,8 +68,9 @@ class SendTemplatePage extends BasePage {
|
||||||
content: Container(
|
content: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(24),
|
bottomLeft: Radius.circular(24),
|
||||||
bottomRight: Radius.circular(24)),
|
bottomRight: Radius.circular(24),
|
||||||
|
),
|
||||||
gradient: LinearGradient(colors: [
|
gradient: LinearGradient(colors: [
|
||||||
Theme.of(context).primaryTextTheme.subhead.color,
|
Theme.of(context).primaryTextTheme.subhead.color,
|
||||||
Theme.of(context).primaryTextTheme.subhead.decorationColor,
|
Theme.of(context).primaryTextTheme.subhead.decorationColor,
|
||||||
|
@ -80,57 +78,15 @@ class SendTemplatePage extends BasePage {
|
||||||
),
|
),
|
||||||
child: Form(
|
child: Form(
|
||||||
key: _formKey,
|
key: _formKey,
|
||||||
child: Column(children: <Widget>[
|
child: Column(
|
||||||
Padding(
|
children: <Widget>[
|
||||||
padding: EdgeInsets.fromLTRB(24, 90, 24, 32),
|
Padding(
|
||||||
child: Column(
|
padding: EdgeInsets.fromLTRB(24, 90, 24, 32),
|
||||||
children: <Widget>[
|
child: Column(
|
||||||
BaseTextFormField(
|
children: <Widget>[
|
||||||
controller: _nameController,
|
BaseTextFormField(
|
||||||
hintText: S.of(context).send_name,
|
controller: _nameController,
|
||||||
borderColor:
|
hintText: S.of(context).send_name,
|
||||||
Theme.of(context).primaryTextTheme.headline.color,
|
|
||||||
textStyle: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Colors.white),
|
|
||||||
placeholderTextStyle: TextStyle(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.primaryTextTheme
|
|
||||||
.headline
|
|
||||||
.decorationColor,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
fontSize: 14),
|
|
||||||
validator: sendTemplateViewModel.templateValidator,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(top: 20),
|
|
||||||
child: AddressTextField(
|
|
||||||
controller: _addressController,
|
|
||||||
onURIScanned: (uri) {
|
|
||||||
var address = '';
|
|
||||||
var amount = '';
|
|
||||||
|
|
||||||
if (uri != null) {
|
|
||||||
address = uri.path;
|
|
||||||
amount = uri.queryParameters['tx_amount'] ??
|
|
||||||
uri.queryParameters['amount'];
|
|
||||||
} else {
|
|
||||||
address = uri.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
_addressController.text = address;
|
|
||||||
_cryptoAmountController.text = amount;
|
|
||||||
},
|
|
||||||
options: [
|
|
||||||
AddressTextFieldOption.paste,
|
|
||||||
AddressTextFieldOption.qrCode,
|
|
||||||
AddressTextFieldOption.addressBook
|
|
||||||
],
|
|
||||||
buttonColor: Theme.of(context)
|
|
||||||
.primaryTextTheme
|
|
||||||
.display1
|
|
||||||
.color,
|
|
||||||
borderColor: Theme.of(context)
|
borderColor: Theme.of(context)
|
||||||
.primaryTextTheme
|
.primaryTextTheme
|
||||||
.headline
|
.headline
|
||||||
|
@ -139,37 +95,122 @@ class SendTemplatePage extends BasePage {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Colors.white),
|
color: Colors.white),
|
||||||
hintStyle: TextStyle(
|
placeholderTextStyle: TextStyle(
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.primaryTextTheme
|
.primaryTextTheme
|
||||||
.headline
|
.headline
|
||||||
.decorationColor),
|
.decorationColor,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 14),
|
||||||
|
validator: sendTemplateViewModel.templateValidator,
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
Padding(
|
padding: EdgeInsets.only(top: 20),
|
||||||
padding: const EdgeInsets.only(top: 20),
|
child: AddressTextField(
|
||||||
child: BaseTextFormField(
|
controller: _addressController,
|
||||||
focusNode: _cryptoAmountFocus,
|
onURIScanned: (uri) {
|
||||||
controller: _cryptoAmountController,
|
var address = '';
|
||||||
|
var amount = '';
|
||||||
|
|
||||||
|
if (uri != null) {
|
||||||
|
address = uri.path;
|
||||||
|
amount = uri.queryParameters['tx_amount'] ??
|
||||||
|
uri.queryParameters['amount'];
|
||||||
|
} else {
|
||||||
|
address = uri.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
_addressController.text = address;
|
||||||
|
_cryptoAmountController.text = amount;
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
AddressTextFieldOption.paste,
|
||||||
|
AddressTextFieldOption.qrCode,
|
||||||
|
AddressTextFieldOption.addressBook
|
||||||
|
],
|
||||||
|
buttonColor: Theme.of(context)
|
||||||
|
.primaryTextTheme
|
||||||
|
.display1
|
||||||
|
.color,
|
||||||
|
borderColor: Theme.of(context)
|
||||||
|
.primaryTextTheme
|
||||||
|
.headline
|
||||||
|
.color,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.white),
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.primaryTextTheme
|
||||||
|
.headline
|
||||||
|
.decorationColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 20),
|
||||||
|
child: BaseTextFormField(
|
||||||
|
focusNode: _cryptoAmountFocus,
|
||||||
|
controller: _cryptoAmountController,
|
||||||
|
keyboardType: TextInputType.numberWithOptions(
|
||||||
|
signed: false, decimal: true),
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.deny(
|
||||||
|
RegExp('[\\-|\\ ]'))
|
||||||
|
],
|
||||||
|
prefixIcon: Padding(
|
||||||
|
padding: EdgeInsets.only(top: 9),
|
||||||
|
child: Text(
|
||||||
|
sendTemplateViewModel.currency.title +
|
||||||
|
':',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Colors.white,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
hintText: '0.0000',
|
||||||
|
borderColor: Theme.of(context)
|
||||||
|
.primaryTextTheme
|
||||||
|
.headline
|
||||||
|
.color,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.white),
|
||||||
|
placeholderTextStyle: TextStyle(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.primaryTextTheme
|
||||||
|
.headline
|
||||||
|
.decorationColor,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 14),
|
||||||
|
validator:
|
||||||
|
sendTemplateViewModel.amountValidator)),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 20),
|
||||||
|
child: BaseTextFormField(
|
||||||
|
focusNode: _fiatAmountFocus,
|
||||||
|
controller: _fiatAmountController,
|
||||||
keyboardType: TextInputType.numberWithOptions(
|
keyboardType: TextInputType.numberWithOptions(
|
||||||
signed: false, decimal: true),
|
signed: false, decimal: true),
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
FilteringTextInputFormatter.deny(RegExp('[\\-|\\ ]'))
|
FilteringTextInputFormatter.deny(
|
||||||
|
RegExp('[\\-|\\ ]'))
|
||||||
],
|
],
|
||||||
prefixIcon: Padding(
|
prefixIcon: Padding(
|
||||||
padding: EdgeInsets.only(top: 9),
|
padding: EdgeInsets.only(top: 9),
|
||||||
child:
|
child: Text(
|
||||||
Text(sendTemplateViewModel
|
sendTemplateViewModel.fiat.title + ':',
|
||||||
.currency.title + ':',
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
hintText: '0.0000',
|
hintText: '0.00',
|
||||||
borderColor: Theme.of(context)
|
borderColor: Theme.of(context)
|
||||||
.primaryTextTheme
|
.primaryTextTheme
|
||||||
.headline
|
.headline
|
||||||
|
@ -185,49 +226,12 @@ class SendTemplatePage extends BasePage {
|
||||||
.decorationColor,
|
.decorationColor,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
fontSize: 14),
|
fontSize: 14),
|
||||||
validator: sendTemplateViewModel
|
)),
|
||||||
.amountValidator)),
|
],
|
||||||
Padding(
|
),
|
||||||
padding: const EdgeInsets.only(top: 20),
|
)
|
||||||
child: BaseTextFormField(
|
],
|
||||||
focusNode: _fiatAmountFocus,
|
),
|
||||||
controller: _fiatAmountController,
|
|
||||||
keyboardType: TextInputType.numberWithOptions(
|
|
||||||
signed: false, decimal: true),
|
|
||||||
inputFormatters: [
|
|
||||||
FilteringTextInputFormatter.deny(RegExp('[\\-|\\ ]'))
|
|
||||||
],
|
|
||||||
prefixIcon: Padding(
|
|
||||||
padding: EdgeInsets.only(top: 9),
|
|
||||||
child: Text(sendTemplateViewModel
|
|
||||||
.fiat.title + ':',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: Colors.white,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
hintText: '0.00',
|
|
||||||
borderColor: Theme.of(context)
|
|
||||||
.primaryTextTheme
|
|
||||||
.headline
|
|
||||||
.color,
|
|
||||||
textStyle: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Colors.white),
|
|
||||||
placeholderTextStyle: TextStyle(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.primaryTextTheme
|
|
||||||
.headline
|
|
||||||
.decorationColor,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
fontSize: 14),
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
]),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
bottomSectionPadding:
|
bottomSectionPadding:
|
||||||
|
|
Loading…
Reference in a new issue