scrollView method

CustomScrollView scrollView({
  1. Key? key,
  2. Axis scrollDirection = Axis.vertical,
  3. bool reverse = false,
  4. ScrollController? controller,
  5. bool? primary,
  6. ScrollPhysics? physics,
  7. ScrollBehavior? scrollBehavior,
  8. bool shrinkWrap = false,
  9. Key? center,
  10. double anchor = 0.0,
  11. double? cacheExtent,
  12. int? semanticChildCount,
  13. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  14. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.onDrag,
  15. String? restorationId,
  16. 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,
  );
}