Giter VIP home page Giter VIP logo

Comments (9)

dakamojo avatar dakamojo commented on July 18, 2024 2

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.

dakamojo avatar dakamojo commented on July 18, 2024

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.

nathanaelhoun avatar nathanaelhoun commented on July 18, 2024

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.

gtgalone avatar gtgalone commented on July 18, 2024

@dakamojo Awesome!!

Could you make a pull request?

from prompt_dialog.

dakamojo avatar dakamojo commented on July 18, 2024

@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.

dakamojo avatar dakamojo commented on July 18, 2024

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.

gtgalone avatar gtgalone commented on July 18, 2024

@dakamojo

Awesome!!

I have just published 1.0.7 with your PR(#13).

Thank you so much!

from prompt_dialog.

mjablecnik avatar mjablecnik commented on July 18, 2024

@gtgalone In pub.dev is still version 1.0.6 as latest version..:
image

from prompt_dialog.

gtgalone avatar gtgalone commented on July 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.