mirror of
https://github.com/Iconica-Development/flutter_profile.git
synced 2025-05-19 09:13:44 +02:00
fixed keyboard closing ontap field
This commit is contained in:
parent
7c30113d9f
commit
e6b1605b89
2 changed files with 19 additions and 24 deletions
|
@ -23,9 +23,7 @@ class ItemBuilder {
|
||||||
inputDecoration =
|
inputDecoration =
|
||||||
options.inputDecorationField?[key] ?? options.inputDecoration;
|
options.inputDecorationField?[key] ?? options.inputDecoration;
|
||||||
|
|
||||||
return Form(
|
return TextFormField(
|
||||||
key: formKey,
|
|
||||||
child: TextFormField(
|
|
||||||
key: Key(key),
|
key: Key(key),
|
||||||
controller: controller,
|
controller: controller,
|
||||||
decoration: inputDecoration,
|
decoration: inputDecoration,
|
||||||
|
@ -38,7 +36,6 @@ class ItemBuilder {
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
return options.validators?[key]?.call(value);
|
return options.validators?[key]?.call(value);
|
||||||
},
|
},
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return widget;
|
return widget;
|
||||||
|
|
|
@ -46,9 +46,7 @@ class ProfileWrapper extends StatefulWidget {
|
||||||
class _ProfileWrapperState extends State<ProfileWrapper> {
|
class _ProfileWrapperState extends State<ProfileWrapper> {
|
||||||
List<Widget> defaultItems = [];
|
List<Widget> defaultItems = [];
|
||||||
|
|
||||||
GlobalKey<FormState> firstNameKey = GlobalKey<FormState>();
|
GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
GlobalKey<FormState> lastNameKey = GlobalKey<FormState>();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
@ -61,7 +59,7 @@ class _ProfileWrapperState extends State<ProfileWrapper> {
|
||||||
defaultItems.add(
|
defaultItems.add(
|
||||||
builder.build(
|
builder.build(
|
||||||
'first_name',
|
'first_name',
|
||||||
firstNameKey,
|
formKey,
|
||||||
widget.user.firstName,
|
widget.user.firstName,
|
||||||
null,
|
null,
|
||||||
(v) {
|
(v) {
|
||||||
|
@ -79,7 +77,7 @@ class _ProfileWrapperState extends State<ProfileWrapper> {
|
||||||
defaultItems.add(
|
defaultItems.add(
|
||||||
builder.build(
|
builder.build(
|
||||||
'last_name',
|
'last_name',
|
||||||
lastNameKey,
|
formKey,
|
||||||
widget.user.lastName,
|
widget.user.lastName,
|
||||||
null,
|
null,
|
||||||
(v) {
|
(v) {
|
||||||
|
@ -98,7 +96,7 @@ class _ProfileWrapperState extends State<ProfileWrapper> {
|
||||||
defaultItems.add(
|
defaultItems.add(
|
||||||
widget.itemBuilder!.build(
|
widget.itemBuilder!.build(
|
||||||
'first_name',
|
'first_name',
|
||||||
firstNameKey,
|
formKey,
|
||||||
widget.user.firstName,
|
widget.user.firstName,
|
||||||
null,
|
null,
|
||||||
(v) {
|
(v) {
|
||||||
|
@ -116,7 +114,7 @@ class _ProfileWrapperState extends State<ProfileWrapper> {
|
||||||
defaultItems.add(
|
defaultItems.add(
|
||||||
widget.itemBuilder!.build(
|
widget.itemBuilder!.build(
|
||||||
'last_name',
|
'last_name',
|
||||||
lastNameKey,
|
formKey,
|
||||||
widget.user.lastName,
|
widget.user.lastName,
|
||||||
null,
|
null,
|
||||||
(v) {
|
(v) {
|
||||||
|
@ -197,7 +195,7 @@ class _ProfileWrapperState extends State<ProfileWrapper> {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
// all the items that have priority above the default items
|
// all the items that have priority above the default items
|
||||||
child,
|
Form(key: formKey, child: child),
|
||||||
if (widget.bottomActionText != null) ...[
|
if (widget.bottomActionText != null) ...[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: widget.style.betweenDefaultItemPadding,
|
height: widget.style.betweenDefaultItemPadding,
|
||||||
|
|
Loading…
Reference in a new issue