create static method

Latest create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "latest",
  3. String? version,
  4. Pubspec? pubspec,
  5. String? archive_url,
  6. String? archive_sha256,
  7. String? published,
})
override

return original data json

Implementation

static Latest create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "latest",
  String? version,
  Pubspec? pubspec,
  String? archive_url,
  String? archive_sha256,
  String? published,
}) {
  // Latest latest = Latest({
  final Map latest_data_create_json = {
    "@type": special_type,
    "version": version,
    "pubspec": (pubspec != null) ? pubspec.toJson() : null,
    "archive_url": archive_url,
    "archive_sha256": archive_sha256,
    "published": published,
  };

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

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