FloatingPullUpCardLayout constructor

FloatingPullUpCardLayout({
  1. Key? key,
  2. required Widget child,
  3. required Widget body,
  4. double? height,
  5. double? width,
  6. double cardElevation = 4,
  7. bool dismissable = false,
  8. FloatingPullUpState? state = FloatingPullUpState.collapsed,
  9. ValueChanged<FloatingPullUpState?>? onStateChange,
  10. DragHandleBuilder? dragHandleBuilder,
  11. Color cardColor = const Color(0xFFFFFFFF),
  12. FloatingCardBuilder? cardBuilder,
  13. BorderRadius borderRadius = const BorderRadius.only(topLeft: Radius.circular(16), topRight: Radius.circular(16)),
  14. StateOffsetFunction? collpsedStateOffset,
  15. StateOffsetFunction? hiddenStateOffset,
  16. UncollapsedStateOffsetFunction? uncollpsedStateOffset,
  17. dynamic autoPadding = true,
  18. FloatingPullUpState? onOutsideTap()?,
  19. bool withOverlay = false,
  20. Color overlayColor = const Color(0x66000000),
})

Implementation

FloatingPullUpCardLayout({
  Key? key,
  required this.child,
  required this.body,
  this.height,
  this.width,
  this.cardElevation = 4,
  this.dismissable = false,
  this.state = FloatingPullUpState.collapsed,
  this.onStateChange,
  this.dragHandleBuilder,
  this.cardColor = const Color(0xFFFFFFFF),
  this.cardBuilder,
  this.borderRadius = const BorderRadius.only(
    topLeft: Radius.circular(16),
    topRight: Radius.circular(16),
  ),
  StateOffsetFunction? collpsedStateOffset,
  StateOffsetFunction? hiddenStateOffset,
  UncollapsedStateOffsetFunction? uncollpsedStateOffset,
  this.autoPadding = true,
  this.onOutsideTap,
  this.withOverlay = false,
  this.overlayColor = const Color(0x66000000),
})  : collpsedStateOffset = collpsedStateOffset ?? _defaultCollpsedStateOffset,
      hiddenStateOffset = hiddenStateOffset ?? _defaultHiddenStateOffset,
      uncollpsedStateOffset = uncollpsedStateOffset ?? _defaultUncollapsedStateOffset,
      super(key: key) {
  final double maxHeightTest = 10000;
  final double cardHeightTest = 8000;
  assert(
    this.uncollpsedStateOffset(maxHeightTest) < this.collpsedStateOffset!(maxHeightTest, cardHeightTest),
  );
  assert(
    this.collpsedStateOffset!(maxHeightTest, cardHeightTest) < this.hiddenStateOffset(maxHeightTest, cardHeightTest),
  );
}