GlassScrollEdge class Panels and controls
The scroll edge effect under a bar, and the bar.
Put it over the scroll view, against the edge it is for, the full width of the screen; extent is how far the bar reaches in from that edge — the status bar and the bar together at the top, the toolbar and the home indicator at the bottom. child is the bar, laid in that extent and lifted with the effect, so it sees glass scrolling under it as the effect does (GlassAbove).
Positioned(
top: 0, left: 0, right: 0,
child: GlassScrollEdge(
side: GlassScrollEdgeSide.top,
extent: MediaQuery.paddingOf(context).top + 60,
child: myAppBar,
),
)
It takes no touches outside child: the effect reaches past the bar and what is under it is still the list.
Styles and sides
| GlassScrollEdgeSide.top | GlassScrollEdgeSide.bottom | |
|---|---|---|
| GlassScrollEdgeStyle.soft | a glass strip of blurSigma under an erf tint | an erf tint, no glass |
| GlassScrollEdgeStyle.hard | a band of hardFillFor | the same band |
The soft tint is kGlassScrollEdgeLightTint or kGlassScrollEdgeDarkTint, by appearanceFor.
Note: the soft top is one glass surface of the screen's width — a slot in the atlas, captured whenever what is under it changes, which under a scrolling list is every frame of the scroll. The soft bottom is a gradient and costs no capture.
See also:
- GlassScaffold, which puts one under its top bar.
- GlassAbove, which lifts the effect and its bar over glass scrolling under them.
- Scroll edge on the site.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- GlassScrollEdge
Constructors
- GlassScrollEdge({required GlassScrollEdgeSide side, required double extent, GlassScrollEdgeStyle style = GlassScrollEdgeStyle.soft, GlassScrollEdgeAppearance? appearance, double blurSigma = kGlassScrollEdgeSigma, Widget? child, Key? key})
-
An effect on
side, for a barextentin from that edge, withchildas the bar.extentmust not be negative.const
Properties
- appearance → GlassScrollEdgeAppearance?
-
Which way a soft edge tints. Not the hard band's colour, which is the
screen's background: see hardFillFor. Null reads the theme's declared
backdrop —
dark below a relative luminance of 0.4, light otherwise or undeclared.
Apple reads the content itself: mid-grey content (code 128) went dark,
light content (code 217) light; the threshold is somewhere between,
at relative luminance 0.22 and 0.69, and 0.4 is a guess inside that.
final
- blurSigma → double
-
The soft edge's blur, logical px. Apple's is kGlassScrollEdgeSigma;
see the file comment for what a sigma other than the host's costs.
final
- child → Widget?
-
The bar, laid out in extent from the edge.
final
- extent → double
-
From the screen edge to the bar's inner edge, logical px.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- reach → double
-
How far the effect reaches in from the screen edge, logical px.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- side → GlassScrollEdgeSide
-
Which edge of the screen the effect is against.
final
- style → GlassScrollEdgeStyle
-
Soft, iOS's, by default; hard is macOS's.
final
Methods
-
appearanceFor(
GlassThemeData theme) → GlassScrollEdgeAppearance -
The appearance in force for
theme: appearance when given, and otherwise read off GlassThemeData.backdrop. -
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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
-
hardFillFor(
GlassThemeData theme, Brightness platform) → Color -
The hard band in force for
theme, with the platform inplatform: the declared backdrop at 0.90, as Apple's band is the screen's background at 0.90; with none declared, kGlassScrollEdgeHardFillDark in the dark appearance — the host's (GlassHost.appearance), or the platform's when the host names a finish — and kGlassScrollEdgeHardFill in the light one.