DraggableBottomSheet constructor
DraggableBottomSheet({
- Key? key,
- double maxHeight = 500,
- double minHeight = 0,
- Duration animationDuration = const Duration(milliseconds: 200),
- Widget? header,
- bool autoSwipped = true,
- bool draggableBody = true,
- bool gradientOpacity = true,
- bool headerVisibilityOnTap = true,
- Color? backgroundColor = Colors.white,
- void onHide()?,
- double radius = 15,
- void onShow()?,
- required Widget body,
Implementation
DraggableBottomSheet(
{super.key,
this.maxHeight = 500,
this.minHeight = 0,
this.animationDuration = const Duration(milliseconds: 200),
this.header,
this.autoSwipped = true,
this.draggableBody = true,
this.gradientOpacity = true,
this.headerVisibilityOnTap = true,
this.backgroundColor = Colors.white,
this.onHide,
this.radius = 15,
this.onShow,
required this.body}) {
if (!GetInstance().isRegistered<BottomSheetController>()) {
Get.put(BottomSheetController());
}
Get.find<BottomSheetController>().maxHeight = maxHeight;
Get.find<BottomSheetController>().animationDuration = animationDuration;
Get.find<BottomSheetController>().minHeight = minHeight;
if (minHeight > Get.find<BottomSheetController>().currentHeight) {
Get.find<BottomSheetController>().currentHeight = minHeight;
}
Get.find<BottomSheetController>().autoSwipped = autoSwipped;
Get.find<BottomSheetController>().onHide = onHide;
Get.find<BottomSheetController>().onShow = onShow;
}