GlassTabBar.minimizable constructor
- required List<
GlassTab> tabs, - required int selectedIndex,
- required ValueChanged<
int> onTabSelected, - Key? key,
- bool minimized = false,
- GlassTabBarMinimizeController? minimizeController,
- VoidCallback? onMinimizedTabTap,
- GlassTabBarTrailingButton? trailingButton,
- GlassTabBarExtraButton? extraButton,
- Widget? bottomAccessory,
- GlassTabBarAccessoryPlacement? bottomAccessoryPlacement,
- bool bottomAccessoryEnabled = true,
- double bottomAccessorySpacing = 6.0,
- double? bottomAccessoryHeight,
- double spacing = 8,
- double horizontalPadding = 20,
- double verticalPadding = 20,
- double barHeight = 64,
- double minimizedBarHeight = 50,
- double barBorderRadius = _kDefaultBottomBorderRadius,
- EdgeInsetsGeometry tabPadding = const EdgeInsets.symmetric(horizontal: 4),
- double iconLabelSpacing = 4,
- bool enableBlend = true,
- bool groupBackdrop = true,
- double blendAmount = 10,
- LiquidGlassSettings? settings,
- bool showIndicator = true,
- Color? indicatorColor,
- LiquidGlassSettings? indicatorSettings,
- double indicatorPinchStrength = 0.4,
- Color? selectedIconColor,
- Color? unselectedIconColor,
- Color? selectedLabelColor,
- Color? unselectedLabelColor,
- TextStyle? selectedLabelStyle,
- TextStyle? unselectedLabelStyle,
- double iconSize = 24,
- double labelFontSize = 11,
- TextStyle? textStyle,
- Duration glowDuration = const Duration(milliseconds: 300),
- double glowBlurRadius = 32,
- double glowSpreadRadius = 8,
- double glowOpacity = 0.6,
- GlassInteractionBehavior interactionBehavior = GlassInteractionBehavior.full,
- double? pressScale,
- Color? interactionGlowColor,
- double? interactionGlowRadius,
- GlassQuality? quality,
- GlassQuality? backgroundQuality,
- double magnification = 1.15,
- double innerBlur = 0.0,
- bool platformViewBackdrop = false,
- bool passthroughOverPlatformView = false,
- MaskingQuality maskingQuality = MaskingQuality.high,
- GlobalKey<
State< ? backgroundKey,StatefulWidget> > - SpringDescription? springDescription,
- GlassTabPillAnchor tabPillAnchor = GlassTabPillAnchor.start,
- double? tabWidth,
- double? indicatorBorderRadius,
- EdgeInsetsGeometry indicatorExpansion = const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
- VoidCallback? onBarTap,
- bool whitenAtBottom = true,
- double whitenBottomThreshold = 45.0,
- double whitenAtBottomTarget = 1.0,
- ScrollController? scrollController,
- bool adaptiveBrightness = false,
- ValueChanged<
Brightness> ? onBrightnessChanged, - ValueListenable<
Brightness> ? brightnessOverride,
Creates a bottom bar that minimizes to the selected tab's circle —
SwiftUI's tabBarMinimizeBehavior, i.e. the GlassTabBar.searchable
morph without the search.
Drives the same layout engine as the searchable placement, so the
minimize is the identical spring morph, but the API speaks navigation
rather than search: minimized replaces isSearchActive (the caller
decides when — typically from scroll direction, matching
.tabBarMinimizeBehavior(.onScrollDown)), tapping the minimized tab
circle fires onMinimizedTabTap (the "bring my tabs back" control),
and the slot the search pill occupies is an optional plain action
button — trailingButton — or nothing at all. Both pills render at
minimizedBarHeight while minimized, mirroring how the native
minimized bar sits slightly smaller than the expanded one.
The trailing slot maps onto the native components:
trailingButton: null— a plain minimizing tab bar; the tabs get the full bar width, and the minimized state is the selected tab's circle alone.- With a
trailingButton, the button is present in both states — exactly how aTab(role: .search)trailing circle keeps its priority visibility through the minimize.
trailingButton may change between builds and the bar animates the
difference: the button spring-scales in and out in place at its slot.
An app that wants a button only while minimized simply passes it only
while minimized is true — the appearing button grows in at the
trailing edge as the tab pill shrinks to its circle.
Minimizing on scroll
Pass a GlassTabBarMinimizeController as minimizeController and the
bar minimizes itself from the scroll view given to scrollController —
the equivalent of .tabBarMinimizeBehavior(.onScrollDown). The
controller then owns the state and minimized is ignored:
GlassTabBar.minimizable(
tabs: tabs,
selectedIndex: index,
onTabSelected: onTabSelected,
minimizeController: _minimize,
scrollController: _scroll,
onMinimizedTabTap: _minimize.expand,
)
A host that cannot reach the current screen's ScrollController leaves
scrollController off and feeds the minimize controller from a
NotificationListener instead — see
GlassTabBarMinimizeController.handleNotification.
Without one, minimized stays a plain controlled prop and the caller
decides when to flip it.
A bottomAccessory follows the bar: with no explicit
bottomAccessoryPlacement it moves inline as the bar minimizes, the way
iOS 26 animates a tabViewBottomAccessory down into the minimized bar.
Pass GlassTabBarAccessoryPlacement.expanded to pin it.
Implementation
const GlassTabBar.minimizable({
required List<GlassTab> tabs,
required int selectedIndex,
required ValueChanged<int> onTabSelected,
Key? key,
bool minimized = false,
GlassTabBarMinimizeController? minimizeController,
VoidCallback? onMinimizedTabTap,
GlassTabBarTrailingButton? trailingButton,
GlassTabBarExtraButton? extraButton,
Widget? bottomAccessory,
GlassTabBarAccessoryPlacement? bottomAccessoryPlacement,
bool bottomAccessoryEnabled = true,
double bottomAccessorySpacing = 6.0,
double? bottomAccessoryHeight,
double spacing = 8,
double horizontalPadding = 20,
double verticalPadding = 20,
double barHeight = 64,
double minimizedBarHeight = 50,
double barBorderRadius = _kDefaultBottomBorderRadius,
EdgeInsetsGeometry tabPadding = const EdgeInsets.symmetric(horizontal: 4),
double iconLabelSpacing = 4,
bool enableBlend = true,
bool groupBackdrop = true,
double blendAmount = 10,
LiquidGlassSettings? settings,
bool showIndicator = true,
Color? indicatorColor,
LiquidGlassSettings? indicatorSettings,
double indicatorPinchStrength = 0.4,
Color? selectedIconColor,
Color? unselectedIconColor,
Color? selectedLabelColor,
Color? unselectedLabelColor,
TextStyle? selectedLabelStyle,
TextStyle? unselectedLabelStyle,
double iconSize = 24,
double labelFontSize = 11,
TextStyle? textStyle,
Duration glowDuration = const Duration(milliseconds: 300),
double glowBlurRadius = 32,
double glowSpreadRadius = 8,
double glowOpacity = 0.6,
GlassInteractionBehavior interactionBehavior =
GlassInteractionBehavior.full,
double? pressScale,
Color? interactionGlowColor,
double? interactionGlowRadius,
GlassQuality? quality,
GlassQuality? backgroundQuality,
double magnification = 1.15,
double innerBlur = 0.0,
bool platformViewBackdrop = false,
bool passthroughOverPlatformView = false,
MaskingQuality maskingQuality = MaskingQuality.high,
GlobalKey? backgroundKey,
SpringDescription? springDescription,
GlassTabPillAnchor tabPillAnchor = GlassTabPillAnchor.start,
double? tabWidth,
double? indicatorBorderRadius,
EdgeInsetsGeometry indicatorExpansion =
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
VoidCallback? onBarTap,
bool whitenAtBottom = true,
double whitenBottomThreshold = 45.0,
double whitenAtBottomTarget = 1.0,
ScrollController? scrollController,
bool adaptiveBrightness = false,
ValueChanged<Brightness>? onBrightnessChanged,
ValueListenable<Brightness>? brightnessOverride,
}) : this._(
key: key,
placement: _GlassTabBarPlacement.minimizable,
tabs: tabs,
selectedIndex: selectedIndex,
onTabSelected: onTabSelected,
isSearchActive: minimized,
onMinimizedTabTap: onMinimizedTabTap,
trailingButton: trailingButton,
extraButton: extraButton,
minimizeController: minimizeController,
bottomAccessoryPlacement: bottomAccessoryPlacement,
bottomAccessory: bottomAccessory,
bottomAccessoryEnabled: bottomAccessoryEnabled,
bottomAccessorySpacing: bottomAccessorySpacing,
bottomAccessoryHeight: bottomAccessoryHeight,
spacing: spacing,
horizontalPadding: horizontalPadding,
verticalPadding: verticalPadding,
barHeight: barHeight,
searchBarHeight: minimizedBarHeight,
barBorderRadius: barBorderRadius,
tabPadding: tabPadding,
iconLabelSpacing: iconLabelSpacing,
enableBlend: enableBlend,
groupBackdrop: groupBackdrop,
blendAmount: blendAmount,
settings: settings,
showIndicator: showIndicator,
indicatorColor: indicatorColor,
indicatorSettings: indicatorSettings,
indicatorPinchStrength: indicatorPinchStrength,
selectedIconColor: selectedIconColor,
unselectedIconColor: unselectedIconColor,
selectedLabelColor: selectedLabelColor,
unselectedLabelColor: unselectedLabelColor,
selectedLabelStyle: selectedLabelStyle,
unselectedLabelStyle: unselectedLabelStyle,
iconSize: iconSize,
labelFontSize: labelFontSize,
textStyle: textStyle,
glowDuration: glowDuration,
glowBlurRadius: glowBlurRadius,
glowSpreadRadius: glowSpreadRadius,
glowOpacity: glowOpacity,
interactionBehavior: interactionBehavior,
pressScale: pressScale,
interactionGlowColor: interactionGlowColor,
interactionGlowRadius: interactionGlowRadius,
quality: quality,
backgroundQuality: backgroundQuality,
magnification: magnification,
innerBlur: innerBlur,
platformViewBackdrop: platformViewBackdrop,
passthroughOverPlatformView: passthroughOverPlatformView,
maskingQuality: maskingQuality,
backgroundKey: backgroundKey,
springDescription: springDescription,
tabPillAnchor: tabPillAnchor,
tabWidth: tabWidth,
indicatorBorderRadius: indicatorBorderRadius,
indicatorExpansion: indicatorExpansion,
onBarTap: onBarTap,
whitenAtBottom: whitenAtBottom,
whitenBottomThreshold: whitenBottomThreshold,
whitenAtBottomTarget: whitenAtBottomTarget,
scrollController: scrollController,
adaptiveBrightness: adaptiveBrightness,
onBrightnessChanged: onBrightnessChanged,
brightnessOverride: brightnessOverride,
);