fix validate on user interaction
This commit is contained in:
parent
ef036f7924
commit
5d8d56cb70
|
@ -60,11 +60,16 @@ class _CustomInputUtilState extends State<CustomInputUtil> {
|
||||||
validator: widget.validator,
|
validator: widget.validator,
|
||||||
autofocus: widget.autoFocus,
|
autofocus: widget.autoFocus,
|
||||||
focusNode: widget.focusNode,
|
focusNode: widget.focusNode,
|
||||||
onChanged: (_) => EasyDebounce.debounce(
|
onChanged: (value) {
|
||||||
|
EasyDebounce.debounce(
|
||||||
'${widget.controller}',
|
'${widget.controller}',
|
||||||
const Duration(milliseconds: 500),
|
const Duration(milliseconds: 500),
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
);
|
||||||
|
if (widget.onChanged != null) {
|
||||||
|
widget.onChanged!(value); // Chamar o callback
|
||||||
|
}
|
||||||
|
},
|
||||||
textInputAction: widget.textInputAction,
|
textInputAction: widget.textInputAction,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
|
|
@ -201,7 +201,8 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
size: dropDownValue2!,
|
size: dropDownValue2!,
|
||||||
)
|
)
|
||||||
.then((response) {
|
.then((response) {
|
||||||
if (response.jsonBody['error'] == true) {
|
if (response.jsonBody['error'] == true ||
|
||||||
|
isFormValid(buildContext!) == false) {
|
||||||
DialogUtil.error(buildContext!,
|
DialogUtil.error(buildContext!,
|
||||||
jsonDecode(response.jsonBody['error_msg'])[0]['message']);
|
jsonDecode(response.jsonBody['error_msg'])[0]['message']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,6 +233,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
.getVariableText(ptText: 'Nome', enText: 'Name'),
|
.getVariableText(ptText: 'Nome', enText: 'Name'),
|
||||||
suffixIcon: Symbols.format_color_text,
|
suffixIcon: Symbols.format_color_text,
|
||||||
haveMaxLength: true,
|
haveMaxLength: true,
|
||||||
|
onChanged: (value) => setState(() {}),
|
||||||
maxLength: 80,
|
maxLength: 80,
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
|
@ -249,6 +250,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
enText: 'e.g. Dog, Cat, Parrot'),
|
enText: 'e.g. Dog, Cat, Parrot'),
|
||||||
suffixIcon: Symbols.sound_detection_dog_barking,
|
suffixIcon: Symbols.sound_detection_dog_barking,
|
||||||
haveMaxLength: true,
|
haveMaxLength: true,
|
||||||
|
onChanged: (value) => setState(() {}),
|
||||||
maxLength: 80,
|
maxLength: 80,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -266,6 +268,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
enText: 'e.g. Labrador, Poodle, Siamese, Persian'),
|
enText: 'e.g. Labrador, Poodle, Siamese, Persian'),
|
||||||
suffixIcon: Icons.pets_outlined,
|
suffixIcon: Icons.pets_outlined,
|
||||||
haveMaxLength: true,
|
haveMaxLength: true,
|
||||||
|
onChanged: (value) => setState(() {}),
|
||||||
maxLength: 80,
|
maxLength: 80,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -283,6 +286,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
enText: 'e.g. Black, Yellow, White'),
|
enText: 'e.g. Black, Yellow, White'),
|
||||||
suffixIcon: Symbols.palette,
|
suffixIcon: Symbols.palette,
|
||||||
haveMaxLength: true,
|
haveMaxLength: true,
|
||||||
|
onChanged: (value) => setState(() {}),
|
||||||
maxLength: 80,
|
maxLength: 80,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -620,6 +624,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
enText: 'Write your observations here...'),
|
enText: 'Write your observations here...'),
|
||||||
suffixIcon: Icons.text_fields,
|
suffixIcon: Icons.text_fields,
|
||||||
haveMaxLength: true,
|
haveMaxLength: true,
|
||||||
|
onChanged: (value) => setState(() {}),
|
||||||
maxLength: 250,
|
maxLength: 250,
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
|
@ -691,6 +696,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
.getVariableText(ptText: 'Nome', enText: 'Name'),
|
.getVariableText(ptText: 'Nome', enText: 'Name'),
|
||||||
suffixIcon: Symbols.format_color_text,
|
suffixIcon: Symbols.format_color_text,
|
||||||
haveMaxLength: true,
|
haveMaxLength: true,
|
||||||
|
onChanged: (value) => setState(() {}),
|
||||||
maxLength: 80,
|
maxLength: 80,
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
|
@ -707,6 +713,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
enText: 'e.g. Dog, Cat, Parrot'),
|
enText: 'e.g. Dog, Cat, Parrot'),
|
||||||
suffixIcon: Symbols.sound_detection_dog_barking,
|
suffixIcon: Symbols.sound_detection_dog_barking,
|
||||||
haveMaxLength: true,
|
haveMaxLength: true,
|
||||||
|
onChanged: (value) => setState(() {}),
|
||||||
maxLength: 80,
|
maxLength: 80,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -724,6 +731,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
enText: 'e.g. Labrador, Poodle, Siamese, Persian'),
|
enText: 'e.g. Labrador, Poodle, Siamese, Persian'),
|
||||||
suffixIcon: Icons.pets_outlined,
|
suffixIcon: Icons.pets_outlined,
|
||||||
haveMaxLength: true,
|
haveMaxLength: true,
|
||||||
|
onChanged: (value) => setState(() {}),
|
||||||
maxLength: 80,
|
maxLength: 80,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -741,6 +749,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
enText: 'e.g. Black, Yellow, White'),
|
enText: 'e.g. Black, Yellow, White'),
|
||||||
suffixIcon: Symbols.palette,
|
suffixIcon: Symbols.palette,
|
||||||
haveMaxLength: true,
|
haveMaxLength: true,
|
||||||
|
onChanged: (value) => setState(() {}),
|
||||||
maxLength: 80,
|
maxLength: 80,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1081,6 +1090,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget>
|
||||||
suffixIcon: Icons.text_fields,
|
suffixIcon: Icons.text_fields,
|
||||||
haveMaxLength: true,
|
haveMaxLength: true,
|
||||||
maxLength: 250,
|
maxLength: 250,
|
||||||
|
onChanged: (value) => setState(() {}),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(70, 20, 70, 30),
|
padding: const EdgeInsets.fromLTRB(70, 20, 70, 30),
|
||||||
|
|
Loading…
Reference in New Issue