DebugOverlay class
A widget that adds a debug overlay to the app, allowing for easy debugging of various components.
The overlay can display logs in a sorted view and inspect HTTP requests with a JSON viewer.
To use the DebugOverlay widget, simply insert it at any point in your widget tree or use DebugOverlay.builder in your WidgetsApp.builder.
It is recommended to use your own builder, as this allows a higher usability and customizability.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DebugOverlay
Constructors
-
DebugOverlay({Key? key, bool visible = false, bool? maintainState, int initialTabIndex = 0, double opacity = 0.9, DetectorBuilder? detectorBuilder, LogBucket? logBucket, HttpBucket? httpBucket, List<
Widget> debugEntries = const [], List<Widget> infoEntries = const [MediaQueryInfoEntry(), PackageInfoEntry(), DeviceInfoEntry(), if (!kIsWeb) PlatformInfoEntry()], required Widget child}) - Creates a DebugOverlay widget.
Properties
- child → Widget
-
The child widget that will be placed in the stack under the overlay.
final
-
debugEntries
→ List<
Widget> -
Custom widgets that will be usable from the debug overlay.
final
- detectorBuilder → DetectorBuilder
-
Allows the injection of a custom detector instead of the default DebugDetector.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
Specifies a list of fields whose values are hidden throughout the overlay.
final
- httpBucket → HttpBucket?
-
Bucket to collect HTTP requests.
final
-
infoEntries
→ List<
Widget> -
Custom information widgets that will be displayed in the "INFO" tab.
final
- initialTabIndex → int
-
Specifies which tab should be initially shown when activating the overlay.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- logBucket → LogBucket?
-
Bucket to collect log entries.
final
- maintainState → bool
-
Whether the overlay should maintain its state while being invisible to the user.
final
- opacity → double
-
Allows the debug overlay to be partially transparent.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- visible → bool
-
Whether the overlay is initially visible.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DebugOverlay> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent 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.
inherited
-
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 short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
builder(
{bool? maintainState, int initialTabIndex = 0, double opacity = 0.9, DetectorBuilder? detectorBuilder, LogBucket? logBucket, HttpBucket? httpBucket, List< Widget> debugEntries = const []}) → TransitionBuilder - Convenience builder for WidgetsApp.builder.
-
maybeOf(
BuildContext? context) → DebugOverlayState? - Finds the DebugOverlayState from the closest instance of this class that encloses the given context.
-
of(
BuildContext context) → DebugOverlayState - Finds the DebugOverlayState from the closest instance of this class that encloses the given context.