scrollView method
CustomScrollView
scrollView({
- Key? key,
- Axis scrollDirection = Axis.vertical,
- bool reverse = false,
- ScrollController? controller,
- bool? primary,
- ScrollPhysics? physics,
- ScrollBehavior? scrollBehavior,
- bool shrinkWrap = false,
- Key? center,
- double anchor = 0.0,
- double? cacheExtent,
- int? semanticChildCount,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.onDrag,
- String? restorationId,
- Clip clipBehavior = Clip.hardEdge,
创建自定义滚动视图
@param scrollDirection 滚动方向(默认垂直方向) @param reverse 是否反向滚动(默认false) @param controller 滚动控制器(可选) @param physics 滚动物理效果(可选) @param shrinkWrap 是否根据内容收缩包裹(默认false) @param clipBehavior 内容裁剪方式(默认硬裁剪) @return 包含当前Sliver组件的CustomScrollView
Implementation
CustomScrollView scrollView(
{Key? key,
Axis scrollDirection = Axis.vertical,
bool reverse = false,
ScrollController? controller,
bool? primary,
ScrollPhysics? physics,
ScrollBehavior? scrollBehavior,
bool shrinkWrap = false,
Key? center,
double anchor = 0.0,
double? cacheExtent,
int? semanticChildCount,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
ScrollViewKeyboardDismissBehavior keyboardDismissBehavior =
ScrollViewKeyboardDismissBehavior.onDrag,
String? restorationId,
Clip clipBehavior = Clip.hardEdge}) {
return CustomScrollView(
slivers: this,
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller,
primary: primary,
physics: physics,
scrollBehavior: scrollBehavior,
shrinkWrap: shrinkWrap,
center: center,
anchor: anchor,
cacheExtent: cacheExtent,
semanticChildCount: semanticChildCount,
dragStartBehavior: dragStartBehavior,
keyboardDismissBehavior: keyboardDismissBehavior,
restorationId: restorationId,
clipBehavior: clipBehavior,
);
}