Q:

Set Textfields to required

In my app, various TextFields have to be filled in, before the user can continue. Some of those are required, some are optional. Is there an easier way to set those TextFields to "required" and "optional" without doing that in bizarre if-else statements and a bunch of overloaded constructors? I tried to do that, but doing something that trivial ´went a little out of hand and a lot of code.
Thanks in advance.

A:

You can Validator class to validate as shown in the below link 
validator example

