GlassTabBar.inline constructor
const
GlassTabBar.inline({
- required List<
GlassTab> tabs, - required int selectedIndex,
- required ValueChanged<
int> onTabSelected, - Key? key,
- double horizontalPadding = 0,
- double verticalPadding = 0,
- double barHeight = 40,
- double barBorderRadius = 100,
- double labelFontSize = 13,
- double iconSize = 18,
- EdgeInsetsGeometry tabPadding = const EdgeInsets.symmetric(horizontal: 8),
- EdgeInsetsGeometry indicatorExpansion = const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
- double magnification = 1.0,
- double innerBlur = 0.0,
- double spacing = 4,
- double blendAmount = 10,
- bool enableBlend = true,
- bool showIndicator = true,
- Color? indicatorColor,
- LiquidGlassSettings? indicatorSettings,
- double indicatorPinchStrength = 0.4,
- double? indicatorBorderRadius,
- Color? selectedIconColor,
- Color? unselectedIconColor,
- Color? selectedLabelColor,
- Color? unselectedLabelColor,
- TextStyle? selectedLabelStyle,
- TextStyle? unselectedLabelStyle,
- TextStyle? textStyle,
- double? tabWidth,
- LiquidGlassSettings? settings,
- GlassQuality? quality,
- MaskingQuality maskingQuality = MaskingQuality.high,
- GlobalKey<
State< ? backgroundKey,StatefulWidget> > - double iconLabelSpacing = 4,
- Duration glowDuration = const Duration(milliseconds: 300),
- double glowBlurRadius = 20,
- double glowSpreadRadius = 4,
- double glowOpacity = 0.5,
- GlassInteractionBehavior interactionBehavior = GlassInteractionBehavior.full,
- double pressScale = 1.02,
- Color? interactionGlowColor,
- double interactionGlowRadius = 1.0,
- bool platformViewBackdrop = false,
- bool adaptiveBrightness = false,
- ValueChanged<
Brightness> ? onBrightnessChanged, - ValueListenable<
Brightness> ? brightnessOverride, - SpringDescription? springDescription,
Creates a compact, in-page glass tab bar with a refracting glass track.
Use this when you need a glass-backed content switcher embedded inside a page — e.g. an Apple Music-style section picker or a search results segment bar that sits on a glass surface.
The track refracts the background behind it via AdaptiveGlass.grouped,
and the indicator uses the same jelly-physics spring as GlassTabBar.bottom.
For a flat, native-fidelity filter/mode control (matching the default
UISegmentedControl appearance), use GlassSegmentedControl instead.
Usage
GlassTabBar.inline(
tabs: const [
GlassTab(label: 'For You'),
GlassTab(label: 'Following'),
GlassTab(label: 'New'),
],
selectedIndex: _selectedIndex,
onTabSelected: (i) => setState(() => _selectedIndex = i),
)
Implementation
const GlassTabBar.inline({
required List<GlassTab> tabs,
required int selectedIndex,
required ValueChanged<int> onTabSelected,
Key? key,
// Compact defaults suited for inline placement
double horizontalPadding = 0,
double verticalPadding = 0,
double barHeight = 40,
double barBorderRadius = 100,
double labelFontSize = 13,
double iconSize = 18,
EdgeInsetsGeometry tabPadding = const EdgeInsets.symmetric(horizontal: 8),
EdgeInsetsGeometry indicatorExpansion =
const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
// No magnification for compact label-centric layout
double magnification = 1.0,
double innerBlur = 0.0,
// Standard shared params
double spacing = 4,
double blendAmount = 10,
bool enableBlend = true,
bool showIndicator = true,
Color? indicatorColor,
LiquidGlassSettings? indicatorSettings,
double indicatorPinchStrength = 0.4,
double? indicatorBorderRadius,
Color? selectedIconColor,
Color? unselectedIconColor,
Color? selectedLabelColor,
Color? unselectedLabelColor,
TextStyle? selectedLabelStyle,
TextStyle? unselectedLabelStyle,
TextStyle? textStyle,
double? tabWidth,
LiquidGlassSettings? settings,
GlassQuality? quality,
MaskingQuality maskingQuality = MaskingQuality.high,
GlobalKey? backgroundKey,
double iconLabelSpacing = 4,
Duration glowDuration = const Duration(milliseconds: 300),
double glowBlurRadius = 20,
double glowSpreadRadius = 4,
double glowOpacity = 0.5,
GlassInteractionBehavior interactionBehavior =
GlassInteractionBehavior.full,
double pressScale = 1.02,
Color? interactionGlowColor,
double interactionGlowRadius = 1.0,
bool platformViewBackdrop = false,
bool adaptiveBrightness = false,
ValueChanged<Brightness>? onBrightnessChanged,
ValueListenable<Brightness>? brightnessOverride,
// Indicator snap spring — null keeps the shared default. Exposed so
// inline hosts can match a reference feel (e.g. Apple Music's snappier
// settle) without forking the physics.
SpringDescription? springDescription,
}) : this._(
key: key,
placement: _GlassTabBarPlacement.inline,
springDescription: springDescription,
tabs: tabs,
selectedIndex: selectedIndex,
onTabSelected: onTabSelected,
horizontalPadding: horizontalPadding,
verticalPadding: verticalPadding,
barHeight: barHeight,
barBorderRadius: barBorderRadius,
labelFontSize: labelFontSize,
iconSize: iconSize,
tabPadding: tabPadding,
indicatorExpansion: indicatorExpansion,
magnification: magnification,
innerBlur: innerBlur,
spacing: spacing,
blendAmount: blendAmount,
enableBlend: enableBlend,
showIndicator: showIndicator,
indicatorColor: indicatorColor,
indicatorSettings: indicatorSettings,
indicatorPinchStrength: indicatorPinchStrength,
indicatorBorderRadius: indicatorBorderRadius,
selectedIconColor: selectedIconColor,
unselectedIconColor: unselectedIconColor,
selectedLabelColor: selectedLabelColor,
unselectedLabelColor: unselectedLabelColor,
selectedLabelStyle: selectedLabelStyle,
unselectedLabelStyle: unselectedLabelStyle,
textStyle: textStyle,
tabWidth: tabWidth,
settings: settings,
quality: quality,
maskingQuality: maskingQuality,
backgroundKey: backgroundKey,
iconLabelSpacing: iconLabelSpacing,
glowDuration: glowDuration,
glowBlurRadius: glowBlurRadius,
glowSpreadRadius: glowSpreadRadius,
glowOpacity: glowOpacity,
interactionBehavior: interactionBehavior,
pressScale: pressScale,
interactionGlowColor: interactionGlowColor,
interactionGlowRadius: interactionGlowRadius,
platformViewBackdrop: platformViewBackdrop,
adaptiveBrightness: adaptiveBrightness,
onBrightnessChanged: onBrightnessChanged,
brightnessOverride: brightnessOverride,
);