Comments (9)
It appears that the validate function is never called.
TextButton(
onPressed: () => Navigator.pop(context, value),
child: (textOK != null) ? textOK : const Text('OK'),
),
should be something like this
TextButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
Navigator.pop(context, value);
},
child: (textOK != null) ? textOK : const Text('OK'),
),
See https://docs.flutter.dev/cookbook/forms/validation
from prompt_dialog.
Update I put a breakpoint and a print statement in the validate itself and neither gets hit so I suspect it's never invoked. Also at this point, I'm only debugging on web, not mobile.
from prompt_dialog.
Thanks for the nice clean widget.
+1, this widget is really good!
Also at this point, I'm only debugging on web, not mobile.
I can confirm the issue also happens on mobile (android)
from prompt_dialog.
@dakamojo Awesome!!
Could you make a pull request?
from prompt_dialog.
@gtgalone I'm making an attempt. But I'm unsure about how to get the key for the form to call validate. In the current implementation the key is based on keyCtr which is incremented every time the ShowPasswordIcon is pressed. Is there a reason the key needs to change? Or can the key be a GlobalKey that doesn't change?
from prompt_dialog.
I am working on this. It seems that the key has to be created from a Stateful Widget, a Stateful Builder doesn't work. I'm refactoring to use a private Stateful Widget but keeping the same functional signature.
from prompt_dialog.
Awesome!!
I have just published 1.0.7 with your PR(#13).
Thank you so much!
from prompt_dialog.
@gtgalone In pub.dev is still version 1.0.6 as latest version..:
from prompt_dialog.
@mjablecnik Thank you so much.
I forgot it. I am so sorry for that :)
I have just published v1.0.7
from prompt_dialog.
Related Issues (15)
- Add text input type support HOT 1
- Set to autofocus: true by default HOT 3
- Press Enter returns the value HOT 2
- installing both prompt and confirm dialog causing prompt to close immediately HOT 1
- initialValue not returned unless textchange HOT 2
- Add validators support HOT 1
- Selection of initial value HOT 2
- Exception from basic example HOT 1
- Inactive InputConnection after second or more calls HOT 1
- Center text input property HOT 1
- isSelectedInitialValue not work HOT 1
- Add onCancel callback HOT 1
- "isSelectedInitialValue" is never used HOT 1
- inputFormatters HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prompt_dialog.