Period constructor

Period({
  1. DateTime? start,
  2. DateTime? end,
})

Creates a new Period instance.

Implementation

Period({
  DateTime? start,
  DateTime? end,
}) : this.fromJson(
        JsonObject({
          if (start != null)
            startField.name: JsonString(start.toIso8601String()),
          if (end != null) endField.name: JsonString(end.toIso8601String()),
        }),
      );