Flutter之滑动列表PageView

class PageView extends StatefulWidget {
  /// Creates a scrollable list that works page by page from an explicit [List]
  /// of widgets.
  ///
  /// This constructor is appropriate for page views with a small number of
  /// children because constructing the [List] requires doing work for every
  /// child that could possibly be displayed in the page view, instead of just
  /// those children that are actually visible.
    从显式[list]创建一个逐页工作的可滚动列表
    的小部件。
    此构造函数适用于数量较少的页面视图
    因为构建[列表]需要为每个人做工作
    可以在页面视图中显示的子元素,而不只是
    这些孩子实际上是可见的。
  PageView({
    Key key, 
    this.scrollDirection = Axis.horizontal, //滚动的方向 支持水平和垂直两个方向
    this.reverse = false, //是否反转滚动
    PageController controller, //pageView控制类
    this.physics,  //手势滚动逻辑,支持:不滚动、总是滚动、与滚动到边缘时是否有bounce
    this.pageSnapping = true, //设置为false以禁用页面捕捉,对自定义滚动行为很有用
    this.onPageChanged, //页面切换时调用
    List<Widget> children = const <Widget>[], //pageView要显示的页面
    this.dragStartBehavior = DragStartBehavior.start,
  }) : controller = controller ?? _defaultPageController,
       childrenDelegate = SliverChildListDelegate(children),
       super(key: key);
}

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值