AnimatedGlassIndicator class

A shared component that renders the interactive "Jelly" indicator used in GlassTabBar, GlassSegmentedControl, and GlassBottomBar.

Handles:

  • Jelly physics (squash and stretch)
  • Thickness-based crossfade between background and glass
  • Positioning and expansion
Inheritance

Constructors

AnimatedGlassIndicator({Key? key, required double velocity, required int itemCount, required AlignmentGeometry alignment, required double thickness, required GlassQuality quality, required Color indicatorColor, required bool isBackgroundIndicator, double borderRadius = GlassDefaults.capsuleRadius, LiquidGlassSettings? settings, EdgeInsetsGeometry padding = EdgeInsets.zero, EdgeInsetsGeometry expansion = const EdgeInsets.all(8.0), GlobalKey<State<StatefulWidget>>? backgroundKey, bool paintBackground = true, bool paintGlass = true, double? exactWidth, double? exactOffset, List<BoxShadow>? shadows, double pinchStrength = 1.0, double innerBlur = 0.0, Axis direction = Axis.horizontal})
Creates a new AnimatedGlassIndicator.
const

Properties

alignment AlignmentGeometry
Current alignment of the indicator.
final
backgroundKey GlobalKey<State<StatefulWidget>>?
Optional background key for Skia/Web refraction
final
borderRadius double
Corner radius of the indicator pill.
final
direction Axis
Axis along which fixed-size indicators travel.
final
exactOffset double?
Optional exact offset from the left (bypasses alignment). Used in scrollable mode where tabs have different widths.
final
exactWidth double?
Optional exact width for varying tab sizes (bypasses widthFactor). Used in scrollable mode where tabs have different widths.
final
expansion EdgeInsetsGeometry
How much to expand the indicator during drag.
final
hashCode int
The hash code for this object.
no setterinherited
indicatorColor Color
Base color for the indicator (used for background mode).
final
innerBlur double
Sigma of the backdrop blur painted behind the RESTING selected pill (Apple-style "frost at rest"). Scaled internally by the resting opacity so it is full when settled and fades out as the pill morphs into the liquid-glass lens during a drag/tap — keeping motion crisp. 0.0 (default) disables it. Only renders on the background-painting indicator (paintBackground == true); reads through a translucent indicatorColor.
final
isBackgroundIndicator bool
Whether this is the background (non-glass) pass.
final
itemCount int
Number of items (tabs/segments).
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
padding EdgeInsetsGeometry
Padding to apply around the indicator (e.g., for GlassBottomBar).
final
paintBackground bool
Whether to render the solid background color pass.
final
paintGlass bool
Whether to render the glass effect shader pass.
final
pinchStrength double
Maximum concave lens pinch strength for the active indicator pill.
final
quality GlassQuality
Rendering quality (standard/premium).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings LiquidGlassSettings?
Optional glass settings override.
final
shadows List<BoxShadow>?
Optional shadows for the solid background indicator.
final
thickness double
Animation value (0.0 to 1.0) indicating drag state. 0 = resting, >0 = dragging/animating.
final
velocity double
Current velocity of the drag gesture.
final

Methods

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

Constants

baseIndicatorSettings → const LiquidGlassSettings
The iOS 26-calibrated default glass settings for all indicator pills.