create static method
Latest
create({
- bool schemeUtilsIsSetDefaultData = false,
- String special_type = "latest",
- String? version,
- Pubspec? pubspec,
- String? archive_url,
- String? archive_sha256,
- 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);
}