isFile static method

bool isFile(
  1. Map<String, dynamic> data,
  2. dynamic value,
  3. String args
)

check field is a file not a file => false if added supported extension in validation, check with extension return true

Implementation

static bool isFile(Map<String, dynamic> data, dynamic value, String args) {
  if (value is! RequestFile) {
    return false;
  }
  if (args.toString().isEmpty) {
    return true;
  }
  List<String> extensions = args.toString().split(',');
  if (extensions.contains(value.extension)) {
    return true;
  }
  return false;
}