ScrollShadow class
Edge overflow shadows for scroll viewports.
Gradient fades appear at the edges with hidden content and slide away as the user scrolls (ScrollShadowVisibility refines when each edge shows). Wrap any scrollable child; supply controller when you manage your own, or rely on the internal one. In iOS and macOS apps (not on the web) a positive blur replaces the gradients with ProgressiveBlur bands that share one backdrop read.
ScrollShadow(
child: ListView(children: items),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ScrollShadow
Constructors
-
ScrollShadow({Key? key, double size = 40.0, double? startSize, double? endSize, Color? color, OrientationToken orientation = OrientationToken.vertical, ScrollController? controller, double offset = 0.0, bool isEnabled = true, ScrollShadowVisibility visibility = ScrollShadowVisibility.auto, ValueChanged<
ScrollShadowVisibility> ? onVisibilityChange, double? blur, BorderRadius? borderRadius, RadiusToken? radius, required Widget child}) -
Creates edge shadows over
child.const
Properties
- blur → double?
-
Blur strength applied to the fade in iOS and macOS apps; ignored on the web and other platforms, and no blur when null or zero.
final
- borderRadius → BorderRadius?
-
Explicit corner radii of the shadow area; takes precedence over radius.
final
- child → Widget
-
The scrollable to wrap.
final
- color → Color?
-
Shadow color. Defaults to the theme background color.
final
- controller → ScrollController?
-
Controller of the wrapped scrollable, used to track the scroll position.
final
- endSize → double?
-
Fade length at the end edge; defaults to size.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEnabled → bool
-
Whether shadows are shown at all.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- offset → double
-
Scroll distance from each end before the shadow starts to appear.
final
-
onVisibilityChange
→ ValueChanged<
ScrollShadowVisibility> ? -
Called when the resolved visibility changes.
final
- orientation → OrientationToken
-
Scroll axis the shadows follow.
final
- radius → RadiusToken?
-
Theme corner-radius token for the shadow area.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → double
-
Length of the fade along the scroll axis, in logical pixels; also the scroll distance over which a shadow fades in.
final
- startSize → double?
-
Fade length at the start edge; defaults to size.
final
- visibility → ScrollShadowVisibility
-
Which edges show shadows; ScrollShadowVisibility.auto follows the scroll position.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ScrollShadow> -
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