UploadFileModel constructor

UploadFileModel({
  1. File? file,
  2. List<int>? bytes,
  3. String? name,
})

Implementation

UploadFileModel({this.file, this.bytes, String? name}) {
  if (file == null && bytes == null) {
    throw ArgumentError("file or bytes argument is required");
  }
  if ((file?.path.split(Util.pathSeparator).last ?? name) == null) {
    throw ArgumentError.notNull("name");
  } else {
    this.name = file?.path.split(Util.pathSeparator).last ?? name!;
  }
}