RecorderLayer class

Widget that wraps part of the widget tree and provides RecorderController to descendant widgets via InheritedWidget

Automatically tracks:

  • Navigation events (route changes)
  • Global scroll events (all scrollable widgets)
  • Drag and swipe gestures

Usage:

RecorderLayer(
  controller: recorderController,
  recordNavigation: true,
  recordGlobalScroll: true,
  child: YourApp(),
)
Inheritance
Available extensions

Constructors

RecorderLayer({Key? key, RecorderController? controller, Replayer? replayer, required Widget child, bool recordNavigation = true, bool recordGlobalScroll = true, bool recordDrag = true, double minScrollDelta = 10.0, bool showControls = true})
const

Properties

child Widget
The child widget tree
final
controller RecorderController?
The controller that manages recording state If not provided, a new RecorderController will be created automatically
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
minScrollDelta double
Minimum scroll delta to record (reduces noise)
final
recordDrag bool
Whether to record drag and swipe gestures
final
recordGlobalScroll bool
Whether to record global scroll events (all scrollable widgets)
final
recordNavigation bool
Whether to record navigation events (route changes)
final
replayer Replayer?
Optional Replayer instance (if not provided, will be created automatically)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showControls bool
Whether to auto-show floating controls (RecorderFAB) on every screen Set to false to hide and manage controls manually
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<RecorderLayer>
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

Static Methods

currentRouteOf(BuildContext context) String?
Gets the current route name from the nearest RecorderLayer ancestor Returns null if no RecorderLayer is found or route is unknown
exists(BuildContext context) bool
Checks if RecorderLayer exists in the widget tree Returns true if found, false otherwise
maybeOf(BuildContext context) RecorderController?
Gets the RecorderController from the nearest RecorderLayer ancestor Returns null if no RecorderLayer is found
Gets a NavigatorObserver that can be added to MaterialApp's navigatorObservers This observer automatically records navigation events with arguments
of(BuildContext context) RecorderController
Gets the RecorderController from the nearest RecorderLayer ancestor Throws an error if no RecorderLayer is found in the widget tree
replayerOf(BuildContext context) Replayer?
Gets the Replayer from the nearest RecorderLayer ancestor Returns null if no RecorderLayer is found
setupGoRouter({required RecorderController controller, required Replayer replayer}) → void
Automatically configures go_router integration