onValidate method

  1. @override
Future<FormsFieldException?> onValidate(
  1. T value
)
override

Implementation

@override
Future<FormsFieldException?> onValidate(T value) async {
  if (value == null ||
      value == false ||
      value is Iterable && value.isEmpty ||
      value is String && value.isEmpty ||
      value is Map && value.isEmpty) {
    return const FormsFieldRequiredException();
  }

  return null;
}