Core Flutter framework primitives.

The features defined in this library are the lowest-level utility classes and functions used by all the other layers of the Flutter framework.


Base class for mixins that provide singleton services (also known as "bindings"). [...]
A BitField over an enum (or other class whose values implement "index"). Only the first 62 values of the enum can be used as indices.
A lazy caching version of Iterable. [...]
A category with which to annotate a class, for documentation purposes. [...]
A class that can be extended or mixed in that provides a change notification API using VoidCallback for notifications. [...]
A base class for providing string and DiagnosticsNode debug representations describing the properties of an object. [...]
DiagnosticsNode that lazily calls the associated Diagnosticable value to implement getChildren and getProperties.
A base class for providing string and DiagnosticsNode debug representations describing the properties and children of an object. [...]
A class that can be used as a mixin that helps dump string and DiagnosticsNode representations of trees. [...]
Builder to accumulate properties and configuration used to assemble a DiagnosticsNode from a Diagnosticable object.
Defines diagnostics data for a value. [...]
Property with a value of type T. [...]
A class annotation to provide a URL to an image that represents the class. [...]
Property describing a double value with an optional unit of measurement. [...]
An property than displays enum values tersely. [...]
Property where the description is either ifTrue or ifFalse depending on whether value is true or false. [...]
Class for information provided to FlutterExceptionHandler callbacks. [...]
An int valued property with an optional unit the value is measured in. [...]
Property with an Iterable<T> value that can be displayed with different DiagnosticsTreeStyle for custom rendering. [...]
A license that covers part of the application's software or assets, to show in an interface such as the LicensePage. [...]
Variant of LicenseEntry for licenses that separate paragraphs with blank lines and that hard-wrap text within paragraphs. Lines that begin with one or more space characters are also assumed to introduce new paragraphs, unless they start with the same number of spaces as the previous line, in which case it's assumed they are a continuation of an indented paragraph. [...]
A string that represents one paragraph in a LicenseEntry. [...]
A registry for packages to add licenses to, so that they can be displayed together in an interface such as the LicensePage. [...]
An object that maintains a list of listeners.
Debugging message displayed like a property. [...]
A property where the important diagnostic information is primarily whether the value is present (non-null) or absent (null), rather than the actual value of the property itself. [...]
A list optimized for containment queries. [...]
Property which clamps a double to between 0 and 1 and formats it as a percentage.
Read-only buffer for reading sequentially from a ByteData instance. [...]
Property which encloses its string value in quotes. [...]
An annotation that provides a short description of a class for use in an index. [...]
A Future whose then implementation calls the callback immediately. [...]
Configuration specifying how a particular DiagnosticsTreeStyle should be rendered as text art. [...]
Constants for useful Unicode characters. [...]
A ChangeNotifier that holds a single value. [...]
Write-only buffer for incrementally building a ByteData instance. [...]


immutable Immutable
Used to annotate a class C. Indicates that C and all subtypes of C must be immutable. [...]
const Immutable()
kMaxUnsignedSMI int
The largest SMI value. [...]
kNoDefaultValue → _NoDefaultValue
Marker object indicating that a DiagnosticsNode has no default value.
const _NoDefaultValue()
mustCallSuper → _MustCallSuper
Used to annotate an instance method m. Indicates that every invocation of a method that overrides m must also invoke m. In addition, every method that overrides m is implicitly annotated with this same annotation. [...]
const _MustCallSuper()
optionalTypeArgs → _OptionalTypeArgs
Used to annotate a class declaration C. Indicates that any type arguments declared on C are to be treated as optional. Tools such as the analyzer and linter can use this information to suppress warnings that would otherwise require type arguments to be provided for instances of C.
const _OptionalTypeArgs()
protected → _Protected
Used to annotate an instance member (method, getter, setter, operator, or field) m in a class C. If the annotation is on a field it applies to the getter, and setter if appropriate, that are induced by the field. Indicates that m should only be invoked from instance methods of C or classes that extend, implement or mix in C, either directly or indirectly. Additionally indicates that m should only be invoked on this, whether explicitly or implicitly. [...]
const _Protected()
required Required
Used to annotate a named parameter p in a method or function f. Indicates that every invocation of f must include an argument corresponding to p, despite the fact that p would otherwise be an optional parameter. [...]
const Required()
timelineWhitelistArguments Map<String, String>
Arguments to whitelist Timeline events in order to be shown in the developer centric version of the Observatory Timeline.
const <String, String> {'mode' : 'basic'}
visibleForTesting → _VisibleForTesting
Used to annotate a declaration was made public, so that it is more visible than otherwise necessary, to make code testable. [...]
const _VisibleForTesting()


dashedTextConfiguration TextTreeConfiguration
Identical to sparseTextConfiguration except that the lines connecting parent to children are dashed. [...]
debugDefaultTargetPlatformOverride TargetPlatform
Override the defaultTargetPlatform. [...]
read / write
debugPrint DebugPrintCallback
Prints a message to the console, which you can access using the "flutter" tool's "logs" command ("flutter logs"). [...]
read / write
debugPrintDone Future<Null>
A Future that resolves when there is no longer any buffered content being printed by debugPrintThrottled (which is the default implementation for debugPrint, which is used to report errors to the console).
defaultTargetPlatform TargetPlatform
The TargetPlatform that matches the platform on which the framework is currently executing. [...]
denseTextConfiguration TextTreeConfiguration
Dense text tree configuration that minimizes horizontal whitespace. [...]
singleLineTextConfiguration TextTreeConfiguration
Render a node as a single line omitting children. [...]
sparseTextConfiguration TextTreeConfiguration
Default text tree configuration. [...]
transitionTextConfiguration TextTreeConfiguration
Configuration that draws a box around a leaf node. [...]
whitespaceTextConfiguration TextTreeConfiguration
Whitespace only configuration where children are consistently indented two spaces. [...]


camelCaseToHyphenatedName(String word) String
Returns a lowercase hyphen-separated version of a camel case name. [...]
debugAssertAllFoundationVarsUnset(String reason, { DebugPrintCallback debugPrintOverride: debugPrintThrottled }) bool
Returns true if none of the foundation library debug variables have been changed. [...]
debugPrintStack({String label, int maxFrames }) → void
Dump the current stack to the console using debugPrint and FlutterError.defaultStackFilter. [...]
debugPrintSynchronously(String message, { int wrapWidth }) → void
Alternative implementation of debugPrint that does not throttle. Used by tests.
debugPrintThrottled(String message, { int wrapWidth }) → void
Implementation of debugPrint that throttles messages. This avoids dropping messages on platforms that rate-limit their logging (for example, Android).
debugWordWrap(String message, int width, { String wrapIndent: '' }) Iterable<String>
Wraps the given string at the given width. [...]
describeEnum(Object enumEntry) String
Returns a short description of an enum value. [...]
describeIdentity(Object object) String
Returns a summary of the runtime type and hash code of object. [...]
listEquals<T>(List<T> a, List<T> b) bool
Compares two lists for deep equality. [...]
profile(VoidCallback function) → void
When running in profile mode (or debug mode), invoke the given function. [...]
setEquals<T>(Set<T> a, Set<T> b) bool
Compares two sets for deep equality. [...]
shortHash(Object object) String
Returns a 5 character long hexadecimal string generated from Object.hashCode's 20 least-significant bits.


The various priority levels used to filter which diagnostics are shown and omitted. [...]
Styles for displaying a node in a DiagnosticsNode tree. [...]
The platform that user interaction should adapt to target. [...]


AsyncCallback() Future<Null>
Signature of callbacks that have no arguments and return no data, but that return a Future to indicate when their work is complete. [...]
AsyncValueGetter() Future<T>
Signature for callbacks that are to asynchronously report a value on demand. [...]
AsyncValueSetter(T value) Future<Null>
Signature for callbacks that report that a value has been set and return a Future that completes when the value has been saved. [...]
ComputePropertyValueCallback() → T
Signature for computing the value of a property. [...]
DebugPrintCallback(String message, { int wrapWidth }) → void
Signature for debugPrint implementations.
FlutterExceptionHandler(FlutterErrorDetails details) → void
Signature for FlutterError.onError handler.
InformationCollector(StringBuffer information) → void
Signature for FlutterErrorDetails.informationCollector callback and other callbacks that collect information into a string buffer.
IterableFilter(Iterable<T> input) Iterable<T>
Signature for callbacks that filter an iterable.
LicenseEntryCollector() Stream<LicenseEntry>
Signature for callbacks passed to LicenseRegistry.addLicense.
ServiceExtensionCallback(Map<String, String> parameters) Future<Map<String, String>>
Signature for service extensions. [...]
ValueChanged(T value) → void
Signature for callbacks that report that an underlying value has changed. [...]
ValueGetter() → T
Signature for callbacks that are to report a value on demand. [...]
ValueSetter(T value) → void
Signature for callbacks that report that a value has been set. [...]
VoidCallback() → void
Signature of callbacks that have no arguments and return no data.

Exceptions / Errors

Error class used to report Flutter-specific assertion failures and contract violations.