create static method

DurationDataScheme create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "durationDataScheme",
  3. num? days,
  4. num? hours,
  5. num? minutes,
  6. num? seconds,
  7. num? milliseconds,
  8. num? microseconds,
})
override

return original data json

Implementation

static DurationDataScheme create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "durationDataScheme",
  num? days,
  num? hours,
  num? minutes,
  num? seconds,
  num? milliseconds,
  num? microseconds,
}) {
  // DurationDataScheme durationDataScheme = DurationDataScheme({
  final Map durationDataScheme_data_create_json = {
    "@type": special_type,
    "days": days,
    "hours": hours,
    "minutes": minutes,
    "seconds": seconds,
    "milliseconds": milliseconds,
    "microseconds": microseconds,
  };

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

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