GlassModalSheet constructor
const
GlassModalSheet({
- Key? key,
- required Widget child,
- double halfSize = 0.45,
- double? fullSize,
- GlassSheetState initialState = GlassSheetState.half,
- double? topBorderRadius = 56,
- double? bottomBorderRadius,
- double? fullTopBorderRadius = 46,
- double? fullBottomBorderRadius,
- double horizontalMargin = 5.0,
- double bottomMargin = 6.0,
- double fillThreshold = 0.60,
- double interactionScale = 1.01,
- bool enableInteractionGlow = true,
- bool enableSaturationGlow = true,
- LiquidGlassSettings? peekSettings,
- LiquidGlassSettings? halfSettings,
- LiquidGlassSettings? fullSettings,
- double stretch = 0.5,
- double resistance = 0.08,
- double snapThreshold = 0.4,
- double velocityThreshold = 700.0,
- LiquidGlassSettings? settings,
- GlassQuality? quality,
- bool platformViewBackdrop = false,
- Color? expandedColor,
- Color? expandedDarkColor,
- GlassModalSheetController? controller,
- ValueChanged<
GlassSheetState> ? onStateChanged, - GlassSheetMode mode = GlassSheetMode.dismissible,
- double peekSize = 90.0,
- GlassFillTransition fillTransition = GlassFillTransition.instant,
- bool showDragIndicator = true,
- Color? dragIndicatorColor,
- double dragIndicatorWidth = 36,
- double dragIndicatorHeight = 4,
- double dragIndicatorTopPadding = 8,
- Color? glowColor,
- double glowRadius = 1.5,
- bool suppressInteractionOnChildren = false,
- EdgeInsetsGeometry? padding,
- bool enableTopFade = false,
- double topFadeHeight = 40.0,
- bool maintainContentGlass = true,
- LiquidGlassSettings? fullStateContentSettings,
- Set<
GlassSheetDetent> detents = const {GlassSheetDetent.medium, GlassSheetDetent.large}, - bool dismissible = true,
- double? peekHorizontalMargin,
- double? peekBottomMargin,
- double? peekWidth,
- double? peekTopBorderRadius,
- double? peekBottomRadius,
- GlassSheetPlacement placement = GlassSheetPlacement.automatic,
Creates a new GlassModalSheet.
Implementation
const GlassModalSheet({
super.key,
required this.child,
this.halfSize = 0.45,
this.fullSize,
this.initialState = GlassSheetState.half,
this.topBorderRadius = 56,
this.bottomBorderRadius,
this.fullTopBorderRadius = 46,
this.fullBottomBorderRadius,
this.horizontalMargin = 5.0,
this.bottomMargin = 6.0,
this.fillThreshold = 0.60,
this.interactionScale = 1.01,
this.enableInteractionGlow = true,
this.enableSaturationGlow = true,
this.peekSettings,
this.halfSettings,
this.fullSettings,
this.stretch = 0.5,
this.resistance = 0.08,
this.snapThreshold = 0.4,
this.velocityThreshold = 700.0,
this.settings,
this.quality,
this.platformViewBackdrop = false,
this.expandedColor,
this.expandedDarkColor,
this.controller,
this.onStateChanged,
this.mode = GlassSheetMode.dismissible,
this.peekSize = 90.0,
this.fillTransition = GlassFillTransition.instant,
this.showDragIndicator = true,
this.dragIndicatorColor,
this.dragIndicatorWidth = 36,
this.dragIndicatorHeight = 4,
this.dragIndicatorTopPadding = 8,
this.glowColor,
this.glowRadius = 1.5,
this.suppressInteractionOnChildren = false,
this.padding,
this.enableTopFade = false,
this.topFadeHeight = 40.0,
this.maintainContentGlass = true,
this.fullStateContentSettings,
this.detents = const {GlassSheetDetent.medium, GlassSheetDetent.large},
this.dismissible = true,
this.peekHorizontalMargin,
this.peekBottomMargin,
this.peekWidth,
this.peekTopBorderRadius,
this.peekBottomRadius,
this.placement = GlassSheetPlacement.automatic,
}) : assert(
detents.length > 0,
'GlassModalSheet needs at least one detent — add medium and/or large '
'(small alone is a floor, not a resting height).');