GlassTabBar.inline constructor

const GlassTabBar.inline({
  1. required List<GlassTab> tabs,
  2. required int selectedIndex,
  3. required ValueChanged<int> onTabSelected,
  4. Key? key,
  5. double horizontalPadding = 0,
  6. double verticalPadding = 0,
  7. double barHeight = 40,
  8. double barBorderRadius = 100,
  9. double labelFontSize = 13,
  10. double iconSize = 18,
  11. EdgeInsetsGeometry tabPadding = const EdgeInsets.symmetric(horizontal: 8),
  12. EdgeInsetsGeometry indicatorExpansion = const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
  13. double magnification = 1.0,
  14. double innerBlur = 0.0,
  15. double spacing = 4,
  16. double blendAmount = 10,
  17. bool enableBlend = true,
  18. bool showIndicator = true,
  19. Color? indicatorColor,
  20. LiquidGlassSettings? indicatorSettings,
  21. double indicatorPinchStrength = 0.4,
  22. double? indicatorBorderRadius,
  23. Color? selectedIconColor,
  24. Color? unselectedIconColor,
  25. Color? selectedLabelColor,
  26. Color? unselectedLabelColor,
  27. TextStyle? selectedLabelStyle,
  28. TextStyle? unselectedLabelStyle,
  29. TextStyle? textStyle,
  30. double? tabWidth,
  31. LiquidGlassSettings? settings,
  32. GlassQuality? quality,
  33. MaskingQuality maskingQuality = MaskingQuality.high,
  34. GlobalKey<State<StatefulWidget>>? backgroundKey,
  35. double iconLabelSpacing = 4,
  36. Duration glowDuration = const Duration(milliseconds: 300),
  37. double glowBlurRadius = 20,
  38. double glowSpreadRadius = 4,
  39. double glowOpacity = 0.5,
  40. GlassInteractionBehavior interactionBehavior = GlassInteractionBehavior.full,
  41. double pressScale = 1.02,
  42. Color? interactionGlowColor,
  43. double interactionGlowRadius = 1.0,
  44. bool platformViewBackdrop = false,
  45. bool adaptiveBrightness = false,
  46. ValueChanged<Brightness>? onBrightnessChanged,
  47. ValueListenable<Brightness>? brightnessOverride,
  48. 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,
      );