create static method

File create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "file",
  3. String special_return_type = "file",
  4. num? id,
  5. num? size,
  6. num? expected_size,
  7. LocalFile? local,
  8. RemoteFile? remote,
})
override

Generate By General Universe Script Dont edit by hand or anything manual

Implementation

static File create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "file",
  String special_return_type = "file",
  num? id,
  num? size,
  num? expected_size,
  LocalFile? local,
  RemoteFile? remote,
}) {
  // File file = File({
  final Map file_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "id": id,
    "size": size,
    "expected_size": expected_size,
    "local": (local != null) ? local.toJson() : null,
    "remote": (remote != null) ? remote.toJson() : null,
  };

  file_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (file_data_create_json.containsKey(key) == false) {
        file_data_create_json[key] = value;
      }
    });
  }
  return File(file_data_create_json);
}