FloatingPullUpCardLayout constructor
FloatingPullUpCardLayout({
- Key? key,
- required Widget child,
- required Widget body,
- double? height,
- double? width,
- double cardElevation = 4,
- bool dismissable = false,
- FloatingPullUpState? state = FloatingPullUpState.collapsed,
- ValueChanged<
FloatingPullUpState?> ? onStateChange, - DragHandleBuilder? dragHandleBuilder,
- Color cardColor = const Color(0xFFFFFFFF),
- FloatingCardBuilder? cardBuilder,
- BorderRadius borderRadius = const BorderRadius.only(topLeft: Radius.circular(16), topRight: Radius.circular(16)),
- StateOffsetFunction? collpsedStateOffset,
- UncollapsedStateOffsetFunction? uncollpsedStateOffset,
- dynamic autoPadding = true,
- FloatingPullUpState? onOutsideTap()?,
- bool withOverlay = false,
- 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),
);
}