예제 #1
0
        public static PageView custom(
            Key key = null,
            Axis scrollDirection                 = Axis.horizontal,
            bool reverse                         = false,
            PageController controller            = null,
            ScrollPhysics physics                = null,
            bool pageSnapping                    = true,
            ValueChanged <int> onPageChanged     = null,
            SliverChildDelegate childrenDelegate = null,
            DragStartBehavior dragStartBehavior  = DragStartBehavior.start,
            bool allowImplicitScrolling          = false
            )
        {
            D.assert(childrenDelegate != null);
            var page = new PageView(
                key: key,
                scrollDirection: scrollDirection,
                reverse: reverse,
                controller: controller ?? PageViewUtils._defaultPageController,
                physics: physics,
                pageSnapping: pageSnapping,
                onPageChanged: onPageChanged,
                allowImplicitScrolling: allowImplicitScrolling,
                dragStartBehavior: dragStartBehavior
                );

            page.childrenDelegate = childrenDelegate;
            return(page);
        }
예제 #2
0
        public static PageView builder(
            Key key = null,
            Axis scrollDirection                = Axis.horizontal,
            bool reverse                        = false,
            PageController controller           = null,
            ScrollPhysics physics               = null,
            bool pageSnapping                   = true,
            ValueChanged <int> onPageChanged    = null,
            IndexedWidgetBuilder itemBuilder    = null,
            int itemCount                       = 0,
            DragStartBehavior dragStartBehavior = DragStartBehavior.start,
            bool allowImplicitScrolling         = false
            )
        {
            var page = new PageView(
                key: key,
                scrollDirection: scrollDirection,
                reverse: reverse,
                controller: controller ?? PageViewUtils._defaultPageController,
                physics: physics,
                pageSnapping: pageSnapping,
                onPageChanged: onPageChanged,
                allowImplicitScrolling: allowImplicitScrolling,
                dragStartBehavior: dragStartBehavior
                );

            page.childrenDelegate = new SliverChildBuilderDelegate(itemBuilder, childCount: itemCount);
            return(page);
        }