passes method
Validates the value using the given context.
Returns true if valid, otherwise false.
Implementation
@override
FutureOr<bool> passes(ValidationContext context) async {
final value = context.value;
final args = context.parameters;
if (value == null || args.isEmpty) return false;
if (!await FileRule().passes(context)) return false;
final minKB = int.tryParse(args[0]);
if (minKB == null) return false;
final minBytes = minKB * 1024;
if (value is UploadedFile) {
return value.size >= minBytes;
}
if (value is List<UploadedFile>) {
return value.every((file) => file.size >= minBytes);
}
return true;
}