foundation library
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.
Classes
- AbstractNode
- An abstract node in a tree. [...]
- BindingBase
- Base class for mixins that provide singleton services (also known as "bindings"). [...]
-
BitField<
T extends dynamic> - 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. [...]
-
CachingIterable<
E> - A lazy caching version of Iterable. [...]
- Category
- A category with which to annotate a class, for documentation purposes. [...]
- ChangeNotifier
- A class that can be extended or mixed in that provides a change notification API using VoidCallback for notifications. [...]
-
DiagnosticableNode<
T extends Diagnosticable> - DiagnosticsNode that lazily calls the associated Diagnosticable value to implement getChildren and getProperties.
- DiagnosticableTree
- A base class for providing string and DiagnosticsNode debug representations describing the properties and children of an object. [...]
- DiagnosticableTreeNode
- DiagnosticsNode for an instance of DiagnosticableTree.
- DiagnosticPropertiesBuilder
- Builder to accumulate properties and configuration used to assemble a DiagnosticsNode from a DiagnosticableMixin object.
- DiagnosticsBlock
- DiagnosticsNode that exists mainly to provide a container for other diagnostics that typically lacks a meaningful value of its own. [...]
- DiagnosticsNode
- Defines diagnostics data for a value. [...]
-
DiagnosticsProperty<
T> -
Property with a value of type
T. [...] - DiagnosticsSerializationDelegate
- A delegate that configures how a hierarchy of DiagnosticsNodes should be serialized. [...]
- DiagnosticsStackTrace
- Diagnostic with a StackTrace value suitable for displaying stack traces as part of a FlutterError object.
- DocumentationIcon
- A class annotation to provide a URL to an image that represents the class. [...]
- DoubleProperty
- Property describing a double value with an optional unit of measurement. [...]
-
EnumProperty<
T> - An property than displays enum values tersely. [...]
- ErrorDescription
- An explanation of the problem and its cause, any information that may help track down the problem, background information, etc. [...]
- ErrorHint
- An ErrorHint provides specific, non-obvious advice that may be applicable. [...]
- ErrorSpacer
- An ErrorSpacer creates an empty DiagnosticsNode, that can be used to tune the spacing between other DiagnosticsNode objects.
- ErrorSummary
- A short (one line) description of the problem that was detected. [...]
-
Factory<
T> - A factory interface that also reports the type of the created objects.
- FlagProperty
- Property where the description is either ifTrue or ifFalse depending on whether value is true or false. [...]
-
FlagsSummary<
T> - A summary of multiple properties, indicating whether each of them is present (non-null) or absent (null). [...]
- FlutterErrorDetails
- Class for information provided to FlutterExceptionHandler callbacks. [...]
-
HashedObserverList<
T> - A list optimized for the observer pattern, but for larger numbers of observers. [...]
- IntProperty
- An int valued property with an optional unit the value is measured in. [...]
-
IterableProperty<
T> -
Property with an
Iterable<T>value that can be displayed with different DiagnosticsTreeStyle for custom rendering. [...] - Key
- A Key is an identifier for Widgets, Elements and SemanticsNodes. [...]
- LicenseEntry
- A license that covers part of the application's software or assets, to show in an interface such as the LicensePage. [...]
- LicenseEntryWithLineBreaks
- 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. [...]
- LicenseParagraph
- A string that represents one paragraph in a LicenseEntry. [...]
- LicenseRegistry
- A registry for packages to add licenses to, so that they can be displayed together in an interface such as the LicensePage. [...]
- Listenable
- An object that maintains a list of listeners. [...]
- LocalKey
- A key that is not a GlobalKey. [...]
- MessageProperty
- Debugging message displayed like a property. [...]
-
ObjectFlagProperty<
T> - 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. [...]
-
ObserverList<
T> - A list optimized for the observer pattern when there are small numbers of observers. [...]
- PartialStackFrame
- Partial information from a stack frame for stack filtering purposes. [...]
- PercentProperty
- Property which clamps a double to between 0 and 1 and formats it as a percentage.
- ReadBuffer
- Read-only buffer for reading sequentially from a ByteData instance. [...]
- RepetitiveStackFrameFilter
- A StackFilter that filters based on repeating lists of PartialStackFrames. [...]
- StackFilter
- A class that filters stack frames for additional filtering on FlutterError.defaultStackFilter.
- StackFrame
- A object representation of a frame from a stack trace. [...]
- StringProperty
- Property which encloses its string value in quotes. [...]
- Summary
- An annotation that provides a short description of a class for use in an index. [...]
-
SynchronousFuture<
T> - A Future whose then implementation calls the callback immediately. [...]
- TextTreeConfiguration
- Configuration specifying how a particular DiagnosticsTreeStyle should be rendered as text art. [...]
- TextTreeRenderer
- Renderer that creates ASCII art representations of trees of DiagnosticsNode objects. [...]
- Unicode
- Constants for useful Unicode characters. [...]
-
ValueKey<
T> - A key that uses a value of a particular type to identify itself. [...]
-
ValueListenable<
T> - An interface for subclasses of Listenable that expose a value. [...]
-
ValueNotifier<
T> - A ChangeNotifier that holds a single value. [...]
- WriteBuffer
- Write-only buffer for incrementally building a ByteData instance. [...]
Mixins
- Diagnosticable
- A mixin class for providing string and DiagnosticsNode debug representations describing the properties of an object. [...]
- DiagnosticableMixin
- A mixin class implementing the Diagnosticable interface that provides string and DiagnosticsNode debug representations describing the properties of an object. [...]
- DiagnosticableTreeMixin
- A mixin that helps dump string and DiagnosticsNode representations of trees. [...]
Constants
- immutable → const Immutable
-
Used to annotate a class
C. Indicates thatCand all subtypes ofCmust be immutable. [...]const Immutable() - kDebugMode → const bool
-
A constant that is true if the application was compiled in debug mode. [...]
!kReleaseMode && !kProfileMode - kIsWeb → const bool
-
A constant that is true if the application was compiled to run on the web. [...]
identical(0, 0.0) - kMaxUnsignedSMI → const int
-
The largest SMI value. [...]
_bitfield.kMaxUnsignedSMI - kNoDefaultValue → const _NoDefaultValue
-
Marker object indicating that a DiagnosticsNode has no default value.
_NoDefaultValue() - kProfileMode → const bool
-
A constant that is true if the application was compiled in profile mode. [...]
bool.fromEnvironment('dart.vm.profile', defaultValue: false) - kReleaseMode → const bool
-
A constant that is true if the application was compiled in release mode. [...]
bool.fromEnvironment('dart.vm.product', defaultValue: false) - mustCallSuper → const _MustCallSuper
-
Used to annotate an instance method
m. Indicates that every invocation of a method that overridesmmust also invokem. In addition, every method that overridesmis implicitly annotated with this same annotation. [...]const _MustCallSuper() - nonVirtual → const _NonVirtual
-
Used to annotate an instance member (method, getter, setter, operator, or
field)
min a classCor mixinM. Indicates thatmshould not be overridden in any classes that extend or mixinCorM. [...]const _NonVirtual() - optionalTypeArgs → const _OptionalTypeArgs
-
Used to annotate a class, mixin, or extension declaration
C. Indicates that any type arguments declared onCare 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 onCto be provided.const _OptionalTypeArgs() - precisionErrorTolerance → const double
-
The epsilon of tolerable double precision error. [...]
1e-10 - protected → const _Protected
-
Used to annotate an instance member (method, getter, setter, operator, or
field)
min a classC. If the annotation is on a field it applies to the getter, and setter if appropriate, that are induced by the field. Indicates thatmshould only be invoked from instance methods ofCor classes that extend, implement or mix inC, either directly or indirectly. Additionally indicates thatmshould only be invoked onthis, whether explicitly or implicitly. [...]const _Protected() - required → const Required
-
Used to annotate a named parameter
pin a method or functionf. Indicates that every invocation offmust include an argument corresponding top, despite the fact thatpwould otherwise be an optional parameter. [...]const Required() -
timelineWhitelistArguments
→ const Map<
String, String> -
Argument passed to Timeline events in order to cause those events to be
shown in the developer-centric version of the Observatory Timeline. [...]
<String, String>{'mode' : 'basic'} - visibleForTesting → const _VisibleForTesting
-
Used to annotate a declaration was made public, so that it is more visible
than otherwise necessary, to make code testable. [...]
const _VisibleForTesting()
Properties
-
compute
→ Future<
R> Function<Q, R>(ComputeCallback< Q, R> callback,Q message, {String debugLabel} ) -
Spawn an isolate, run
callbackon that isolate, passing itmessage, and (eventually) return the value returned bycallback. [...]final - dashedTextConfiguration → TextTreeConfiguration
-
Identical to sparseTextConfiguration except that the lines connecting
parent to children are dashed. [...]
final
- debugDefaultTargetPlatformOverride ↔ TargetPlatform
-
Override the defaultTargetPlatform. [...]
read / write
- debugDoublePrecision ↔ int
-
Configure debugFormatDouble using num.toStringAsPrecision. [...]
read / write
- debugInstrumentationEnabled ↔ bool
-
Boolean value indicating whether debugInstrumentAction will instrument
actions in debug builds.
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<
void> -
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).
read-only
- defaultTargetPlatform → TargetPlatform
-
The TargetPlatform that matches the platform on which the framework is
currently executing. [...]
read-only
- denseTextConfiguration → TextTreeConfiguration
-
Dense text tree configuration that minimizes horizontal whitespace. [...]
final
- errorPropertyTextConfiguration → TextTreeConfiguration
-
Render the name on a line followed by the body and properties on the next
line omitting the children. [...]
final
- errorTextConfiguration → TextTreeConfiguration
-
Configuration that draws a box around a node ignoring the connection to the
parents. [...]
final
- flatTextConfiguration → TextTreeConfiguration
-
Whitespace only configuration where children are not indented. [...]
final
- shallowTextConfiguration → TextTreeConfiguration
-
Render a node on multiple lines omitting children. [...]
final
- singleLineTextConfiguration → TextTreeConfiguration
-
Render a node as a single line omitting children. [...]
final
- sparseTextConfiguration → TextTreeConfiguration
-
Default text tree configuration. [...]
final
- transitionTextConfiguration → TextTreeConfiguration
-
Configuration that draws a box around a leaf node. [...]
final
- whitespaceTextConfiguration → TextTreeConfiguration
-
Whitespace only configuration where children are consistently indented
two spaces. [...]
final
Functions
-
binarySearch<
T extends Comparable< (Object> >List< T> sortedList,T value ) → int -
Returns the position of
valuein thesortedList, if it exists. [...] -
consolidateHttpClientResponseBytes(
HttpClientResponse response, {bool autoUncompress: true, BytesReceivedCallback onBytesReceived} ) → Future< Uint8List> - Efficiently converts the response body of an HttpClientResponse into a Uint8List. [...]
-
debugAssertAllFoundationVarsUnset(
String reason, {DebugPrintCallback debugPrintOverride: debugPrintThrottled} ) → bool - Returns true if none of the foundation library debug variables have been changed. [...]
-
debugFormatDouble(
double value ) → String - Formats a double to have standard formatting. [...]
-
debugInstrumentAction<
T> (String description, Future< T> action()) → Future< T> -
Runs the specified
action, timing how long the action takes in debug builds when debugInstrumentationEnabled is true. [...] -
debugPrintStack(
{StackTrace stackTrace, String label, int maxFrames} ) → void - Dump the 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. [...]
-
mapEquals<
T, U> (Map< T, U> a,Map< T, U> b) → bool - Compares two maps for deep equality. [...]
-
objectRuntimeType(
Object object, String optimizedValue ) → String -
Framework code should use this method in favor of calling
toStringon Object.runtimeType. [...] -
profile(
VoidCallback function ) → void -
DEPRECATED.
functioncannot be tree-shaken out of release builds. [...]@Deprecated('Use `if (!kReleaseMode) { function(); }` instead. ' 'This feature was deprecated after v1.3.9.') -
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.
Enums
- DiagnosticLevel
- The various priority levels used to filter which diagnostics are shown and omitted. [...]
- DiagnosticsTreeStyle
- Styles for displaying a node in a DiagnosticsNode tree. [...]
- TargetPlatform
- The platform that user interaction should adapt to target. [...]
Typedefs
-
AsyncCallback(
) → Future< void> - Signature of callbacks that have no arguments and return no data, but that return a Future to indicate when their work is complete. [...]
-
AsyncValueGetter<
T> () → Future< T> - Signature for callbacks that are to asynchronously report a value on demand. [...]
-
AsyncValueSetter<
T> (T value ) → Future< void> - Signature for callbacks that report that a value has been set and return a Future that completes when the value has been saved. [...]
-
BytesReceivedCallback(
int cumulative, int total ) → void - Signature for getting notified when chunks of bytes are received while consolidating the bytes of an HttpClientResponse into a Uint8List. [...]
-
ComputeCallback<
Q, R> (Q message ) → FutureOr< R> - Signature for the callback passed to compute. [...]
-
ComputePropertyValueCallback<
T> () → T - Signature for computing the value of a property. [...]
-
DebugPrintCallback(
String message, {int wrapWidth} ) → void - Signature for debugPrint implementations.
-
DiagnosticPropertiesTransformer(
Iterable< DiagnosticsNode> properties) → Iterable< DiagnosticsNode> - Signature for DiagnosticPropertiesBuilder transformer.
-
FlutterExceptionHandler(
FlutterErrorDetails details ) → void - Signature for FlutterError.onError handler.
-
InformationCollector(
) → Iterable< DiagnosticsNode> - Signature for FlutterErrorDetails.informationCollector callback and other callbacks that collect information describing an error.
-
IterableFilter<
T> (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, dynamic> > - Signature for service extensions. [...]
-
ValueChanged<
T> (T value ) → void - Signature for callbacks that report that an underlying value has changed. [...]
-
ValueGetter<
T> () → T - Signature for callbacks that are to report a value on demand. [...]
-
ValueSetter<
T> (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
- FlutterError
- Error class used to report Flutter-specific assertion failures and contract violations. [...]

