FlutterError class Null safety

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

See also:

Inheritance
Implemented types
Mixed in types

Constructors

FlutterError(String message)
Create an error message from a string.
factory
FlutterError.fromParts(List<DiagnosticsNode> diagnostics)
Create an error message from a list of DiagnosticsNodes.

Properties

diagnostics List<DiagnosticsNode>
The information associated with this error, in structured form.
final
hashCode int
The hash code for this object.
read-onlyinherited
message String
The message associated with this error.
read-onlyoverride
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
stackTrace StackTrace?
The stack trace at the point where this error was first thrown.
read-onlyinherited

Methods

debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
override
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
override

Operators

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

Static Properties

demangleStackTrace StackTraceDemangler
Called by the Flutter framework before attempting to parse a StackTrace.
read / write
onError FlutterExceptionHandler?
Called whenever the Flutter framework catches an error.
read / write
presentError FlutterExceptionHandler
Called whenever the Flutter framework wants to present an error to the users.
read / write

Static Methods

addDefaultStackFilter(StackFilter filter) → void
Adds a stack filtering function to defaultStackFilter.
defaultStackFilter(Iterable<String> frames) Iterable<String>
Converts a stack to a string that is more readable by omitting stack frames that correspond to Dart internals.
dumpErrorToConsole(FlutterErrorDetails details, {bool forceReport = false}) → void
Prints the given exception details to the console.
reportError(FlutterErrorDetails details) → void
Calls onError with the given details, unless it is null.
resetErrorCount() → void
Resets the count of errors used by dumpErrorToConsole to decide whether to show a complete error message or an abbreviated one.

Constants

wrapWidth → const int
The width to which dumpErrorToConsole will wrap lines.
100