ListView(
     Key key = null,
     Axis scrollDirection                 = Axis.vertical,
     bool reverse                         = false,
     ScrollController controller          = null,
     bool?primary                         = null,
     ScrollPhysics physics                = null,
     bool shrinkWrap                      = false,
     EdgeInsets padding                   = null,
     float?itemExtent                     = null,
     SliverChildDelegate childrenDelegate = null,
     float?cacheExtent                    = null
     ) : base(
         key: key,
         scrollDirection: scrollDirection,
         reverse: reverse,
         controller: controller,
         primary: primary,
         physics: physics,
         shrinkWrap: shrinkWrap,
         padding: padding,
         cacheExtent: cacheExtent
         )
 {
     D.assert(childrenDelegate != null);
     this.itemExtent       = itemExtent;
     this.childrenDelegate = childrenDelegate;
 }
 public GridView(
     Key key = null,
     Axis scrollDirection                 = Axis.vertical,
     bool reverse                         = false,
     ScrollController controller          = null,
     bool?primary                         = null,
     ScrollPhysics physics                = null,
     bool shrinkWrap                      = false,
     EdgeInsets padding                   = null,
     SliverGridDelegate gridDelegate      = null,
     SliverChildDelegate childrenDelegate = null,
     float?cacheExtent                    = null,
     DragStartBehavior dragStartBehavior  = DragStartBehavior.start
     ) : base(
         key: key,
         scrollDirection: scrollDirection,
         reverse: reverse,
         controller: controller,
         primary: primary,
         physics: physics,
         shrinkWrap: shrinkWrap,
         padding: padding,
         cacheExtent: cacheExtent,
         dragStartBehavior: dragStartBehavior
         )
 {
     D.assert(gridDelegate != null);
     D.assert(childrenDelegate != null);
     this.gridDelegate     = gridDelegate;
     this.childrenDelegate = childrenDelegate;
 }
 public static ListView custom(
     Key key = null,
     Axis scrollDirection                 = Axis.vertical,
     bool reverse                         = false,
     ScrollController controller          = null,
     bool?primary                         = null,
     ScrollPhysics physics                = null,
     bool shrinkWrap                      = false,
     EdgeInsets padding                   = null,
     float?itemExtent                     = null,
     SliverChildDelegate childrenDelegate = null,
     float?cacheExtent                    = null
     )
 {
     return(new ListView(
                key,
                scrollDirection,
                reverse,
                controller,
                primary,
                physics,
                shrinkWrap,
                padding,
                itemExtent,
                childrenDelegate,
                cacheExtent));
 }
 public static GridView custom(
     Key key = null,
     Axis scrollDirection                 = Axis.vertical,
     bool reverse                         = false,
     ScrollController controller          = null,
     bool?primary                         = null,
     ScrollPhysics physics                = null,
     bool shrinkWrap                      = false,
     EdgeInsets padding                   = null,
     SliverGridDelegate gridDelegate      = null,
     SliverChildDelegate childrenDelegate = null,
     float?cacheExtent                    = null,
     DragStartBehavior dragStartBehavior  = DragStartBehavior.start
     )
 {
     return(new GridView(
                key: key,
                scrollDirection: scrollDirection,
                reverse: reverse,
                controller: controller,
                primary: primary,
                physics: physics,
                shrinkWrap: shrinkWrap,
                padding: padding,
                gridDelegate: gridDelegate,
                childrenDelegate: childrenDelegate,
                cacheExtent: cacheExtent,
                dragStartBehavior: dragStartBehavior
                ));
 }
Exemple #5
0
 public SliverFillViewport(
     Key key = null, SliverChildDelegate del = null,
     float viewportFraction = 1.0f) : base(key: key, del: del)
 {
     D.assert(viewportFraction > 0.0);
     this.viewportFraction = viewportFraction;
 }
Exemple #6
0
 public PageView(
     Key key = null,
     Axis scrollDirection                = Axis.horizontal,
     bool reverse                        = false,
     PageController controller           = null,
     ScrollPhysics physics               = null,
     bool pageSnapping                   = true,
     ValueChanged <int> onPageChanged    = null,
     List <Widget> children              = null,
     DragStartBehavior dragStartBehavior = DragStartBehavior.start,
     IndexedWidgetBuilder itemBuilder    = null,
     SliverChildDelegate childDelegate   = null,
     int itemCount                       = 0
     ) : base(key: key)
 {
     this.scrollDirection   = scrollDirection;
     this.reverse           = reverse;
     this.physics           = physics;
     this.pageSnapping      = pageSnapping;
     this.onPageChanged     = onPageChanged;
     this.dragStartBehavior = dragStartBehavior;
     this.controller        = controller ?? PageViewUtils._defaultPageController;
     if (itemBuilder != null)
     {
         this.childrenDelegate = new SliverChildBuilderDelegate(itemBuilder, childCount: itemCount);
     }
     else if (childDelegate != null)
     {
         this.childrenDelegate = childDelegate;
     }
     else
     {
         this.childrenDelegate = new SliverChildListDelegate(children ?? new List <Widget>());
     }
 }
Exemple #7
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);
        }
 public SliverFixedExtentList(
     Key key = null,
     SliverChildDelegate del = null,
     float itemExtent        = 0
     ) : base(key: key, del: del)
 {
     this.itemExtent = itemExtent;
 }
 protected SliverMultiBoxAdaptorWidget(
     Key key = null,
     SliverChildDelegate del = null
     ) : base(key: key)
 {
     D.assert(del != null);
     this.del = del;
 }
 public SliverPrototypeExtentList(
     Key key = null,
     SliverChildDelegate del = null,
     Widget prototypeItem    = null
     ) : base(key: key, del: del)
 {
     this.prototypeItem = prototypeItem;
 }
Exemple #11
0
 public _SliverFillViewportRenderObjectWidget(
     Key key = null,
     SliverChildDelegate _delegate = null,
     float viewportFraction        = 1.0f
     ) : base(key: key, del: _delegate)
 {
     D.assert(viewportFraction > 0.0);
     this.viewportFraction = viewportFraction;
 }
 public SliverGrid(
     Key key = null,
     SliverChildDelegate layoutDelegate = null,
     SliverGridDelegate gridDelegate    = null
     ) : base(key: key, del: layoutDelegate)
 {
     D.assert(layoutDelegate != null);
     D.assert(gridDelegate != null);
     this.gridDelegate = gridDelegate;
 }
Exemple #13
0
 public SliverFillViewport(
     Key key = null,
     SliverChildDelegate _delegate = null,
     float viewportFraction        = 1.0f,
     bool padEnds = true
     ) : base(key: key)
 {
     D.assert(viewportFraction > 0.0);
     this._delegate        = _delegate;
     this.viewportFraction = viewportFraction;
     this.padEnds          = padEnds;
 }
        public override void update(Widget newWidgetRaw)
        {
            var newWidget = (SliverMultiBoxAdaptorWidget)newWidgetRaw;
            SliverMultiBoxAdaptorWidget oldWidget = widget;

            base.update(newWidget);
            SliverChildDelegate newDelegate = newWidget.del;
            SliverChildDelegate oldDelegate = oldWidget.del;

            if (newDelegate != oldDelegate &&
                (newDelegate.GetType() != oldDelegate.GetType() || newDelegate.shouldRebuild(oldDelegate)))
            {
                performRebuild();
            }
        }
 public abstract bool shouldRebuild(SliverChildDelegate oldDelegate);
 public override bool shouldRebuild(SliverChildDelegate oldDelegate)
 {
     return(true);
 }
 public override bool shouldRebuild(SliverChildDelegate oldDelegate)
 {
     return(children != ((SliverChildListDelegate)oldDelegate).children);
 }
 public SliverList(
     Key key = null,
     SliverChildDelegate del = null
     ) : base(key: key, del: del)
 {
 }