AnimatedGlassIndicator class

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

Handles:

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

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, IndicatorJelly? jelly, bool clampExpansionToTrack = false})
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
clampExpansionToTrack → bool
Whether the lifted lens' horizontal expansion is capped by the room left to the ends of the track (plus padding), so the lens can reach the bar's edge but never grow past it. Used with the native jelly.
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
jelly → IndicatorJelly?
Native iOS-style jelly deformation (see IndicatorJellyPhysics).
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 GlassTabBar.bottom).
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
glassContextMenu({Key? key, required List<Widget> actions, WidgetBuilder? previewBuilder, bool enabled = true, bool enableHaptics = true, double borderRadius = 32.0, double? previewBorderRadius, double rowBorderRadius = 16.0, BorderRadius? rowCorners, Color? originSlotColor, Color? backgroundColor, LiquidGlassSettings? settings, GlassQuality? quality, double backdropBlur = 0.0, Color? barrierColor, double menuWidth = 250.0, VoidCallback? onOpened, VoidCallback? onDismissed, Duration longPressDuration = const Duration(milliseconds: 700)}) → Widget

Available on Widget, provided by the GlassContextMenuExtension extension

Wraps this widget in a GlassContextMenu displaying actions on long-press or right-click.
glassFullScreenCover({required bool isPresented, VoidCallback? onDismiss, required WidgetBuilder content, bool enableSwipeToDismiss = true, double dismissThreshold = 140.0, LiquidGlassSettings? settings, GlassQuality? quality}) → Widget

Available on Widget, provided by the GlassFullScreenCoverExtension extension

Presents a full-viewport modal cover whenever isPresented is true.

Available on Widget, provided by the GlassNavigationTitleExtension extension

Annotates this widget with a navigation title that drives enclosing or descendant GlassAppBar / GlassAppBar.pinned bars (when their explicit title is null) as well as header accessibility semantics.
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 27-calibrated default glass settings for all indicator pills.