validate method
Validates the given value
against the validation rule.
value
: The value to be validated.fields
: A map of form field states for cross-field validation.
Returns true
if the validation passes, false
otherwise.
Implementation
@override
bool validate(File? value, Map<String, dynamic> fields) {
if (value == null) return false;
return value.lengthSync() <= maxSizeInBytes;
}