SlidingSheet constructor

SlidingSheet({
  1. Key? key,
  2. SheetBuilder? builder,
  3. CustomSheetBuilder? customBuilder,
  4. SheetBuilder? headerBuilder,
  5. SheetBuilder? footerBuilder,
  6. SnapSpec snapSpec = const SnapSpec(),
  7. Duration duration = const Duration(milliseconds: 1000),
  8. SlidingSheetStateController? slidingSheetStateController,
  9. Color? color,
  10. Color? backdropColor,
  11. Color? shadowColor = Colors.black54,
  12. double elevation = 0.0,
  13. EdgeInsets? padding,
  14. bool avoidStatusBar = false,
  15. EdgeInsets? margin,
  16. EdgeInsets? marginWhenExpanded,
  17. Border? border,
  18. double cornerRadius = 0.0,
  19. double? cornerRadiusWhenExpanded = 0.0,
  20. bool closeOnBackdropTap = false,
  21. SheetListener? listener,
  22. SheetController? controller,
  23. ScrollSpec scrollSpec = const ScrollSpec(overscroll: false),
  24. double maxWidth = double.infinity,
  25. double? minHeight,
  26. bool closeSheetOnBackButtonPressed = false,
  27. bool isBackdropInteractable = false,
  28. Widget? body,
  29. ParallaxSpec? parallaxSpec,
  30. double axisAlignment = 0.0,
  31. bool extendBody = false,
  32. double liftOnScrollHeaderElevation = 0.0,
  33. double liftOnScrollFooterElevation = 0.0,
  34. bool isDismissable = true,
  35. OnDismissPreventedCallback? onDismissPrevented,
  36. SystemUiOverlayStyle? systemUiOverlayStyle,
  37. SystemUiOverlayStyle? systemUiOverlayStyleWhenExpanded,
})

Creates a sheet than can be dragged and scrolled in a single gesture to be placed inside you widget tree.

Implementation

SlidingSheet({
  Key? key,
  this.builder,
  this.customBuilder,
  this.headerBuilder,
  this.footerBuilder,
  this.snapSpec = const SnapSpec(),
  this.duration = const Duration(milliseconds: 1000),
  this.slidingSheetStateController,
  this.color,
  this.backdropColor,
  this.shadowColor = Colors.black54,
  this.elevation = 0.0,
  this.padding,
  this.avoidStatusBar = false,
  this.margin,
  this.marginWhenExpanded,
  this.border,
  this.cornerRadius = 0.0,
  this.cornerRadiusWhenExpanded = 0.0,
  this.closeOnBackdropTap = false,
  this.listener,
  this.controller,
  this.scrollSpec = const ScrollSpec(overscroll: false),
  this.maxWidth = double.infinity,
  this.minHeight,
  this.closeSheetOnBackButtonPressed = false,
  this.isBackdropInteractable = false,
  this.body,
  this.parallaxSpec,
  this.axisAlignment = 0.0,
  this.extendBody = false,
  this.liftOnScrollHeaderElevation = 0.0,
  this.liftOnScrollFooterElevation = 0.0,
  this.isDismissable = true,
  this.onDismissPrevented,
  this.systemUiOverlayStyle,
  this.systemUiOverlayStyleWhenExpanded,
})  : assert(builder != null || customBuilder != null),
      assert(builder == null || customBuilder == null),
      assert(snapSpec.snappings.isNotEmpty,
          'There must be at least one extent to snap in between.'),
      assert(snapSpec.minSnap <= snapSpec.maxSnap,
          'The min and max snaps cannot be equal.'),
      assert(axisAlignment >= -1.0 && axisAlignment <= 1.0),
      assert(liftOnScrollHeaderElevation >= 0.0),
      assert(liftOnScrollFooterElevation >= 0.0),
      super(key: key);