Extension constructor

Extension({
  1. Uri? url,
  2. FixedList<Extension>? extension,
  3. bool? valueBoolean,
})

Constructs a new Extension with an optional URL, nested extensions, and a boolean value.

Implementation

Extension({
  Uri? url,
  FixedList<Extension>? extension,
  bool? valueBoolean,
}) : this.fromJson(
        JsonObject({
          if (url != null) urlField.name: JsonString(url.toString()),
          if (extension != null)
            extensionField.name:
                JsonArray(extension.map((e) => e.json).toList()),
          if (valueBoolean != null)
            valueBooleanField.name: JsonBoolean(valueBoolean),
        }),
      );