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 = 56,
  7. double? bottomBorderRadius,
  8. double? fullTopBorderRadius = 46,
  9. double? fullBottomBorderRadius,
  10. double horizontalMargin = 5.0,
  11. double bottomMargin = 6.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 snapThreshold = 0.4,
  22. double velocityThreshold = 700.0,
  23. LiquidGlassSettings? settings,
  24. GlassQuality? quality,
  25. bool platformViewBackdrop = false,
  26. Color? expandedColor,
  27. Color? expandedDarkColor,
  28. GlassModalSheetController? controller,
  29. ValueChanged<GlassSheetState>? onStateChanged,
  30. GlassSheetMode mode = GlassSheetMode.dismissible,
  31. double peekSize = 90.0,
  32. GlassFillTransition fillTransition = GlassFillTransition.instant,
  33. bool showDragIndicator = true,
  34. Color? dragIndicatorColor,
  35. double dragIndicatorWidth = 36,
  36. double dragIndicatorHeight = 4,
  37. double dragIndicatorTopPadding = 8,
  38. Color? glowColor,
  39. double glowRadius = 1.5,
  40. bool suppressInteractionOnChildren = false,
  41. EdgeInsetsGeometry? padding,
  42. bool enableTopFade = false,
  43. double topFadeHeight = 40.0,
  44. bool maintainContentGlass = true,
  45. LiquidGlassSettings? fullStateContentSettings,
  46. Set<GlassSheetDetent> detents = const {GlassSheetDetent.medium, GlassSheetDetent.large},
  47. bool dismissible = true,
  48. double? peekHorizontalMargin,
  49. double? peekBottomMargin,
  50. double? peekWidth,
  51. double? peekTopBorderRadius,
  52. double? peekBottomRadius,
  53. 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).');