GlassModalSheet constructor

const GlassModalSheet({
  1. Key? key,
  2. required Widget child,
  3. double halfSize = 0.45,
  4. double? fullSize,
  5. GlassSheetState initialState = GlassSheetState.half,
  6. double? topBorderRadius = 38,
  7. double? bottomBorderRadius,
  8. double? fullTopBorderRadius = 38,
  9. double? fullBottomBorderRadius,
  10. double horizontalMargin = 8.0,
  11. double bottomMargin = 8.0,
  12. double fillThreshold = 0.60,
  13. double interactionScale = 1.01,
  14. bool enableInteractionGlow = true,
  15. bool enableSaturationGlow = true,
  16. LiquidGlassSettings? peekSettings,
  17. LiquidGlassSettings? halfSettings,
  18. LiquidGlassSettings? fullSettings,
  19. double stretch = 0.5,
  20. double resistance = 0.08,
  21. double? minDetentResistance,
  22. double snapThreshold = 0.4,
  23. double velocityThreshold = 700.0,
  24. LiquidGlassSettings? settings,
  25. GlassQuality? quality,
  26. bool platformViewBackdrop = false,
  27. Color? expandedColor,
  28. Color? expandedDarkColor,
  29. GlassSurfaceStyle surfaceStyle = GlassSurfaceStyle.glass,
  30. GlassModalSheetController? controller,
  31. ValueChanged<GlassSheetState>? onStateChanged,
  32. GlassSheetMode mode = GlassSheetMode.dismissible,
  33. double peekSize = 90.0,
  34. GlassFillTransition fillTransition = GlassFillTransition.instant,
  35. bool showDragIndicator = true,
  36. Color? dragIndicatorColor,
  37. double dragIndicatorWidth = 36,
  38. double dragIndicatorHeight = 5,
  39. double dragIndicatorTopPadding = 5,
  40. Color? glowColor,
  41. double glowRadius = 1.5,
  42. bool suppressInteractionOnChildren = false,
  43. EdgeInsetsGeometry? padding,
  44. bool enableTopFade = false,
  45. double topFadeHeight = 40.0,
  46. bool maintainContentGlass = true,
  47. LiquidGlassSettings? fullStateContentSettings,
  48. Set<GlassSheetDetent> detents = const {GlassSheetDetent.medium, GlassSheetDetent.large},
  49. bool dismissible = true,
  50. double? peekHorizontalMargin,
  51. double? peekBottomMargin,
  52. double? peekWidth,
  53. double? peekTopBorderRadius,
  54. double? peekBottomRadius,
  55. 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 = 38,
  this.bottomBorderRadius,
  this.fullTopBorderRadius = 38,
  this.fullBottomBorderRadius,
  this.horizontalMargin = 8.0,
  this.bottomMargin = 8.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.minDetentResistance,
  this.snapThreshold = 0.4,
  this.velocityThreshold = 700.0,
  this.settings,
  this.quality,
  this.platformViewBackdrop = false,
  this.expandedColor,
  this.expandedDarkColor,
  this.surfaceStyle = GlassSurfaceStyle.glass,
  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 = 5,
  this.dragIndicatorTopPadding = 5,
  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, '
          'or fitted (small alone is a floor, not a resting height).');