ToggleSheet constructor
const
ToggleSheet({
- required ToggleSheetController scrollController,
- ScrollPhysics? physics,
- HitTestBehavior? hitTestBehavior = HitTestBehavior.opaque,
- ToggleSheetStart startConfig = ToggleSheetStart.animate,
- ToggleSheetDelegate<
ShapeBorder?> ? shapeBorderDelegate, - ToggleSheetDelegate<
EdgeInsets?> ? paddingDelegate, - bool shouldPop()?,
- Widget? outside,
- double? topHeaderOffset,
- Widget? topHeader,
- Widget? dragger = const DraggerContainer(),
- Widget? header,
- Widget? sliver,
- List<
Widget> ? content, - EdgeInsets? contentPadding,
- Color? safeAreaColor,
- Color? backgroundColor,
- ToggleSheetDelegate<
Color?> ? barrierColorDelegate, - ToggleSheetDelegate<
double> ? outsideOpacityDelegate, - bool drawOutsideWidgetBehindBackground = false,
- bool offsetOutsideWidgetByTopheader = true,
- bool resizeToAvoidBottomPadding = true,
- bool useSafeArea = true,
- Key? key,
Creates a ToggleSheet widget.
The ToggleSheet widget provides a customizable sheet that can be toggled open or closed. Use this constructor to configure its appearance and behavior.
Note:
It is recommended not to use ToggleSheet inside a SafeArea widget,
as it manages its own padding and will remove any inherited paddings to ensure proper layout.
Instead, you can use the useSafeArea property to control whether the sheet respects safe area insets.
Implementation
const ToggleSheet({
required this.scrollController,
this.physics,
this.hitTestBehavior = HitTestBehavior.opaque,
this.startConfig = ToggleSheetStart.animate,
this.shapeBorderDelegate,
this.paddingDelegate,
this.shouldPop,
this.outside,
this.topHeaderOffset,
this.topHeader,
this.dragger = const DraggerContainer(),
this.header,
this.sliver,
this.content,
this.contentPadding,
this.footer,
this.footerInsideHeaderLayer = false,
this.safeAreaColor,
this.backgroundColor,
this.barrierColorDelegate,
this.outsideOpacityDelegate,
this.drawOutsideWidgetBehindBackground = false,
this.offsetOutsideWidgetByTopheader = true,
this.resizeToAvoidBottomPadding = true,
this.useSafeArea = true,
super.key,
});