CoreFlags class

Opt-in behaviors that change the defaults. Every flag is off by default. Pass it as AppConfig(flags: ...).

AppConfig(appKey: key, flags: const CoreFlags(onlyPresent: true));
AppConfig(appKey: key, flags: const CoreFlags.all());

Each isolate builds its own AppConfig, so each one reads the same flags. Dox reads them when the code runs, from Dox().flags.

Constructors

CoreFlags({bool laravelErrors = false, bool onlyPresent = false, bool cookieDefaults = false, bool hasKeyOnly = false, bool htmlStrings = false, bool replaceHeaders = false, bool decryptServerError = false, bool cacheCopies = false, bool envExpand = false, bool rateLimitIpv6Prefix = false})
const
CoreFlags.all()
Every flag on.
const

Properties

cacheCopies → bool
Cache().store('x'), .tag() and .tags() give a new Cache, and the first one does not change. Off: they change the same object.
final
cookieDefaults → bool
A DoxCookie with no path gets Path=/, and one with no sameSite gets SameSite=Lax. Off: no Path and no SameSite.
final
decryptServerError → bool
A DecryptException gives 500 and is reported by the ExceptionHandler. Off: it gives 400 and is not reported.
final
envExpand → bool
.env values can use ${OTHER} (unquoted or in "..."), and a "..." value reads \n, \t, \", \\ and \$. Off: values are read as they are written.
final
hashCode → int
The hash code for this object.
no setterinherited
hasKeyOnly → bool
req.has('x') is true when the key is in the input, with any value (also '' or null), like req.exists('x'). Off: '' and null give false.
final
htmlStrings → bool
A string from a controller is sent as text/html. A content type set by the app wins. Off: text/plain.
final
laravelErrors → bool
A 422 answer is {"message": "...", "errors": {"field": ["..."]}}, with all messages of each field. Off: {"field": "first message"}.
final
onlyPresent → bool
req.only([...]) leaves out keys that are not in the input. Off: a missing key is in the map with null.
final
rateLimitIpv6Prefix → bool
The default key of RateLimit counts an IPv6 client by its /64 prefix, and an IPv4-mapped address (::ffff:1.2.3.4) as its IPv4 address. A client with a /64 has 2^64 addresses, so with one count per address it gets a fresh count with each new address. Clients in the same /64 now share one count. A key from the app is used as it is. Off: each full ip has its own count.
final
replaceHeaders → bool
res.header(k, v) replaces a value of the header that is already on the response (for example one set by a middleware). Off: it adds a second value. res.header(k, v, replace: ...) wins over this flag.
final
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
A string representation of this object.
inherited

Operators

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