PeekOverlay class final
A draggable button floating over the app that opens Peek.
Wrap the app with it once:
MaterialApp(
builder: (context, child) => PeekOverlay(
enabled: kDebugMode,
child: child!,
),
);
The button carries a badge counting failed and still-running calls, and hides itself while a PeekScreen is open. It is only as wide as it looks: taps anywhere else reach the app underneath.
Prefer a gesture instead of a button? Peek brings no shake detector of
its own; wire a package such as shake to showPeek and leave
enabled off.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PeekOverlay
Constructors
- PeekOverlay({required Widget child, Peek? peek, bool enabled = true, Alignment alignment = Alignment.bottomRight, PeekStrings strings = const PeekStrings(), Key? key})
-
Creates the overlay over
child.const
Properties
- alignment → Alignment
-
Where the button rests before it is dragged.
final
- child → Widget
-
The app the button floats over.
final
- enabled → bool
-
Whether the button is there at all. When
falsethe overlay costs nothing: child is returned untouched.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- peek → Peek?
-
Which instance to watch and open; Peek.instance when omitted.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
What hands an export to the platform; see PeekScreen.share.
final
- strings → PeekStrings
-
The words to show.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PeekOverlay> -
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, int wrapWidth = 65}) → 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
Constants
- How wide and tall the button's tap target is.