Format enum

Output formatting strategies applied after RFC 3986 percent-encoding.

The encoder encodes components according to RFC 3986 and then applies the selected Format.formatter to each token when building the final string. Use:

  • Format.rfc3986 for strict, standards-compliant output (default).
  • Format.rfc1738 to emulate legacy x-www-form-urlencoded where spaces are rendered as +.
Inheritance
Available extensions

Values

rfc1738 → const Format

https://datatracker.ietf.org/doc/html/rfc1738

Legacy application/x-www-form-urlencoded style: converts %20 to + for spaces and leaves all other percent-escapes intact. Useful when interoperating with systems that still expect + for spaces.

const Format(_rfc1738Formatter)
rfc3986 → const Format

https://datatracker.ietf.org/doc/html/rfc3986 (default)

Strict RFC 3986 output: leaves the percent-encoded string unchanged, including spaces as %20. Prefer this unless you must match legacy forms.

const Format(_rfc3986Formatter)

Properties

formatter Formatter
The normalization function applied to each percent-encoded token.
final
hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns the case name ("rfc1738" / "rfc3986"), handy for logging.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<Format>
A constant List of the values in this enum, in order of their declaration.