nylo-core / nylo

Nylo is the fastest way to build your next Flutter mobile app. Streamline your projects with Nylo's opinionated approach to building Flutter apps. Develop your next idea ⚡️
https://nylo.dev
MIT License
597 stars 61 forks source link

NyTextField #81

Closed RoxDevvv closed 1 year ago

RoxDevvv commented 1 year ago

am using NyTextField it works well however how could I know if all fields are correct when I press submit button Thank you

agordn52 commented 1 year ago

Hi @RoxDevvv,

You can create a function in the Widget and use the validate helper to check the data 👍

// Example
_login() {
    String emailExample = 'anthony@web.com';

    validate(rules: {
      "email address": "email" // validation rule 'email'
    }, data: {
      "email address": emailExample
    }, onSuccess: () {
      print('looks good');
      // do something...
    });
}

Check out the docs to learn more