create static method

Sections create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String? id,
  3. String? title,
  4. num? grantedpoints,
  5. num? maxpoints,
  6. String? status,
  7. String? summary,
  8. String special_type = "sections",
})
override

return original data json

Implementation

static Sections create({
  bool schemeUtilsIsSetDefaultData = false,
  String? id,
  String? title,
  num? grantedpoints,
  num? maxpoints,
  String? status,
  String? summary,
  String special_type = "sections",
}) {
  // Sections sections = Sections({
  final Map sections_data_create_json = {
    "id": id,
    "title": title,
    "grantedPoints": grantedpoints,
    "maxPoints": maxpoints,
    "status": status,
    "summary": summary,
    "@type": special_type,
  };

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

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