Middleware class

Constructors

Middleware({Map<String, String> config = const {}, String? id, String? type})
Returns a new Middleware instance.

Properties

config ↔ Map<String, String>
Config is the transform's parameters: redirectScheme takes scheme (default https) and permanent ("true" ⇒ 301, else 302); stripPrefix REQUIRES prefixes (comma-separated, first match wins); addPrefix REQUIRES prefix; headers is a header→value map set on the response.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
id ↔ String?
ID identifies the transform within the org: A-Za-z0-9-_., at most 128 chars. A create that omits it gets a generated one. Routes reference it by this id.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type ↔ String?
Type is the transform: redirectScheme, stripPrefix, addPrefix or headers.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

fromJson(dynamic value) → Middleware?
Returns a new Middleware instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<Middleware>
mapFromJson(dynamic json) → Map<String, Middleware>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<Middleware>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.