PlinthScroller class

A back-to-top affordance that appears once there is something to go back to, matching Mantine's Scroller helpers around ScrollArea.

Wraps a scrollable and watches its controller: past threshold the button fades in, and tapping it animates back to the start.

It listens rather than rebuilding the subtree — the button's visibility is driven by an AnimatedOpacity fed from the scroll position, so scrolling a long list doesn't rebuild the list on every pixel.

PlinthScroller(
  controller: _controller,
  child: ListView(controller: _controller, children: [...]),
)
Inheritance

Constructors

PlinthScroller({Key? key, required ScrollController controller, required Widget child, double threshold = 200, AlignmentGeometry alignment = Alignment.bottomRight, EdgeInsetsGeometry padding = const EdgeInsets.all(16), Duration? duration, String? color, Widget icon = const Icon(Icons.arrow_upward), String semanticLabel = 'Back to top'})
const

Properties

alignment → AlignmentGeometry
final
child → Widget
final
color → String?
final
controller → ScrollController
The same controller the scrollable inside uses. Shared rather than created here, because the child has to be built with it.
final
duration → Duration?
Null takes the value from the theme, which is what almost every caller wants. It cannot be a default here: a default must be const and a theme lookup is not.
final
hashCode → int
The hash code for this object.
no setterinherited
icon → Widget
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
padding → EdgeInsetsGeometry
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel → String
final
threshold → double
Pixels scrolled before the button appears.
final

Methods

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