keerthana s
keerthana s

Reputation: 17

How do I make the helper text in textform field appear conditionally

How do I make the helper text in textformfield appear conditionally I don't want helper text if there is no error and need when the error message needs to be displayed

helperText: Validator.validate(value) != null ? '' : null;

Can it be conditionally delivered or is there any solution to do so?

Upvotes: 0

Views: 35

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599866

If you want to conditionally give the helperText property a value, that'd be:

helperText: Validator.validate(value) != null ? value: '';

Upvotes: 1

Related Questions