validator property

(String? Function(String? value)?) validator
final

Validator to be executed when FormController.validate is executed.

It is executed before onSaved is called.

The current value is passed to value and if it returns a value other than Null, the character is displayed as error text.

If a character other than Null is returned, onSaved will not be executed and FormController.validate will return false.

FormController.validateが実行されたときに実行されるバリデーター。

onSavedが呼ばれる前に実行されます。

valueに現在の値が渡され、Null以外の値を返すとその文字がエラーテキストとして表示されます。

Null以外の文字を返した場合、onSavedは実行されず、FormController.validatefalseが返されます。

Implementation

final String? Function(String? value)? validator;