MdcUriPolicy class final

Controls which links and images may produce navigable destinations.

Constructors

MdcUriPolicy({Set<String> linkSchemes = const <String>{'http', 'https', 'mailto', 'tel'}, Set<String> imageSchemes = const <String>{'http', 'https'}, bool allowRelative = true, bool allowProtocolRelative = false})
Creates an MDC URI policy.
const

Properties

allowProtocolRelative → bool
Whether network-path references such as //cdn.example/image.png work.
final
allowRelative → bool
Whether paths, fragments, and query-only references are accepted.
final
hashCode → int
The hash code for this object.
no setterinherited
imageSchemes → Set<String>
Lowercase URI schemes accepted by image sources.
final
linkSchemes → Set<String>
Lowercase URI schemes accepted by link destinations.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

image(String value) → String?
Returns a safe image source, or null when value is rejected.
Returns a safe link destination, or null when value is rejected.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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