public static PageView builder( IndexedWidgetBuilder itemBuilder, Key key = null, Axis scrollDirection = Axis.horizontal, bool reverse = false, PageController controller = null, ScrollPhysics physics = null, bool pageSnapping = true, ValueChanged <int> onPageChanged = null, int itemCount = 0, DragStartBehavior dragStartBehavior = DragStartBehavior.start ) { return(new PageView( itemBuilder: itemBuilder, key: key, scrollDirection: scrollDirection, reverse: reverse, controller: controller, physics: physics, pageSnapping: pageSnapping, onPageChanged: onPageChanged, itemCount: itemCount, dragStartBehavior: dragStartBehavior )); }
protected ScrollPosition( ScrollPhysics physics = null, ScrollContext context = null, bool keepScrollOffset = true, ScrollPosition oldPosition = null, string debugLabel = null ) { D.assert(physics != null); D.assert(context != null); D.assert(context.vsync != null); this.physics = physics; this.context = context; this.keepScrollOffset = keepScrollOffset; this.debugLabel = debugLabel; if (oldPosition != null) { this.absorb(oldPosition); } if (keepScrollOffset) { this.restoreScrollOffset(); } }
public ScrollPositionWithSingleContext( ScrollPhysics physics = null, ScrollContext context = null, float?initialPixels = 0.0f, bool keepScrollOffset = true, ScrollPosition oldPosition = null, string debugLabel = null ) : base( physics: physics, context: context, keepScrollOffset: keepScrollOffset, oldPosition: oldPosition, debugLabel: debugLabel ) { if (this._pixels == null && initialPixels != null) { this.correctPixels(initialPixels.Value); } if (this.activity == null) { this.goIdle(); } D.assert(this.activity != null); }
public SingleChildScrollView( Key key = null, Axis scrollDirection = Axis.vertical, bool reverse = false, EdgeInsets padding = null, bool?primary = null, ScrollPhysics physics = null, ScrollController controller = null, Widget child = null, DragStartBehavior dragStartBehavior = DragStartBehavior.start ) : base(key: key) { D.assert(!(controller != null && primary == true), () => "Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. " + "You cannot both set primary to true and pass an explicit controller."); this.scrollDirection = scrollDirection; this.reverse = reverse; this.padding = padding; this.primary = primary ?? controller == null && scrollDirection == Axis.vertical; this.physics = physics; this.controller = controller; this.child = child; this.dragStartBehavior = dragStartBehavior; }
void _updatePosition() { this._configuration = ScrollConfiguration.of(this.context); this._physics = this._configuration.getScrollPhysics(this.context); if (this.widget.physics != null) { this._physics = this.widget.physics.applyTo(this._physics); } ScrollController controller = this.widget.controller; ScrollPosition oldPosition = this.position; if (oldPosition != null) { if (controller != null) { controller.detach(oldPosition); } Window.instance.scheduleMicrotask(oldPosition.dispose); } this._position = controller == null ? null : controller.createScrollPosition(this._physics, this, oldPosition); this._position = this._position ?? new ScrollPositionWithSingleContext(physics: this._physics, context: this, oldPosition: oldPosition); D.assert(this.position != null); if (controller != null) { controller.attach(this.position); } }
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>()); } }
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)); }
bool _shouldUpdatePosition(Scrollable oldWidget) { ScrollPhysics newPhysics = widget.physics; ScrollPhysics oldPhysics = oldWidget.physics; do { Type newPhysicsType = newPhysics != null?newPhysics.GetType() : null; Type oldPhysicsType = oldPhysics != null?oldPhysics.GetType() : null; if (newPhysicsType != oldPhysicsType) { return(true); } if (newPhysics != null) { newPhysics = newPhysics.parent; } if (oldPhysics != null) { oldPhysics = oldPhysics.parent; } } while (newPhysics != null || oldPhysics != null); Type controllerType = widget.controller == null ? null : widget.controller.GetType(); Type oldControllerType = oldWidget.controller == null ? null : oldWidget.controller.GetType(); return(controllerType != oldControllerType); }
public static ListView seperated( 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, IndexedWidgetBuilder itemBuilder = null, IndexedWidgetBuilder separatorBuilder = null, int itemCount = 0, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, float?cacheExtent = null ) { return(new ListView( key, scrollDirection, reverse, controller, primary, physics, shrinkWrap, padding, itemBuilder, separatorBuilder, itemCount, addAutomaticKeepAlives, addRepaintBoundaries, cacheExtent )); }
public 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, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, float?cacheExtent = null, List <Widget> children = 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 ) { this.itemExtent = itemExtent; this.childrenDelegate = new SliverChildListDelegate( children, addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries ); }
public BoxScrollView( 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?cacheExtent = null, DragStartBehavior dragStartBehavior = DragStartBehavior.start ) : base( key: key, scrollDirection: scrollDirection, reverse: reverse, controller: controller, primary: primary, physics: physics, shrinkWrap: shrinkWrap, cacheExtent: cacheExtent, dragStartBehavior: dragStartBehavior ) { this.padding = padding; }
public CustomScrollView( Key key = null, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController controller = null, bool?primary = null, ScrollPhysics physics = null, bool shrinkWrap = false, Key center = null, float anchor = 0.0f, float?cacheExtent = null, List <Widget> slivers = null, DragStartBehavior dragStartBehavior = DragStartBehavior.start ) : base( key: key, scrollDirection: scrollDirection, reverse: reverse, controller: controller, primary: primary, physics: physics, shrinkWrap: shrinkWrap, center: center, anchor: anchor, cacheExtent: cacheExtent, dragStartBehavior: dragStartBehavior ) { this.slivers = slivers ?? new List <Widget>(); }
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; }
protected ScrollView( Key key = null, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController controller = null, bool?primary = null, ScrollPhysics physics = null, bool shrinkWrap = false, float?cacheExtent = null ) : base(key: key) { D.assert(!(controller != null && primary == true), "Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. " + "You cannot both set primary to true and pass an explicit controller."); primary = primary ?? controller == null && scrollDirection == Axis.vertical; physics = physics ?? (primary.Value ? new AlwaysScrollableScrollPhysics() : null); this.scrollDirection = scrollDirection; this.reverse = reverse; this.controller = controller; this.primary = primary.Value; this.physics = physics; this.shrinkWrap = shrinkWrap; this.cacheExtent = cacheExtent; }
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 override ScrollPhysics applyTo(ScrollPhysics ancestor) { return(new _ForceImplicitScrollPhysics( allowImplicitScrolling: allowImplicitScrolling, parent: buildParent(ancestor) )); }
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); }
public static ListWheelScrollView useDelegate( float itemExtent, List <Widget> children = null, ListWheelChildDelegate childDelegate = null, Key key = null, ScrollController controller = null, ScrollPhysics physics = null, float diameterRatio = RenderListWheelViewport.defaultDiameterRatio, float perspective = RenderListWheelViewport.defaultPerspective, float offAxisFraction = 0.0f, bool useMagnifier = false, float magnification = 1.0f, ValueChanged <int> onSelectedItemChanged = null, bool clipToSize = true, bool renderChildrenOutsideViewport = false ) { return(new ListWheelScrollView( itemExtent: itemExtent, children: children, childDelegate: childDelegate, key: key, controller: controller, physics: physics, diameterRatio: diameterRatio, perspective: perspective, offAxisFraction: offAxisFraction, useMagnifier: useMagnifier, magnification: magnification, onSelectedItemChanged: onSelectedItemChanged, clipToSize: clipToSize, renderChildrenOutsideViewport: renderChildrenOutsideViewport )); }
public _ForceImplicitScrollPhysics( bool allowImplicitScrolling = false, ScrollPhysics parent = null ) : base(parent: parent) { this.allowImplicitScrolling = allowImplicitScrolling; }
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 )); }
protected ScrollView( Key key = null, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController controller = null, bool?primary = null, ScrollPhysics physics = null, bool shrinkWrap = false, Key center = null, float anchor = 0.0f, float?cacheExtent = null, DragStartBehavior dragStartBehavior = DragStartBehavior.start ) : base(key: key) { D.assert(!(controller != null && primary == true), () => "Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. " + "You cannot both set primary to true and pass an explicit controller."); D.assert(!shrinkWrap || center == null); D.assert(anchor >= 0.0f && anchor <= 1.0f); primary = primary ?? controller == null && scrollDirection == Axis.vertical; physics = physics ?? (primary.Value ? new AlwaysScrollableScrollPhysics() : null); this.scrollDirection = scrollDirection; this.reverse = reverse; this.controller = controller; this.primary = primary.Value; this.physics = physics; this.shrinkWrap = shrinkWrap; this.center = center; this.anchor = anchor; this.cacheExtent = cacheExtent; this.dragStartBehavior = dragStartBehavior; }
public static GridView builder( 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, IndexedWidgetBuilder itemBuilder = null, int?itemCount = null, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, float?cacheExtent = null ) { return(new GridView( key: key, scrollDirection: scrollDirection, reverse: reverse, controller: controller, primary: primary, physics: physics, shrinkWrap: shrinkWrap, padding: padding, gridDelegate: gridDelegate, itemBuilder: itemBuilder, itemCount: itemCount, addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries, cacheExtent: cacheExtent )); }
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, IndexedWidgetBuilder itemBuilder = null, int?itemCount = null, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, float?cacheExtent = null ) : base( key: key, scrollDirection: scrollDirection, reverse: reverse, controller: controller, primary: primary, physics: physics, shrinkWrap: shrinkWrap, padding: padding, cacheExtent: cacheExtent ) { this.gridDelegate = gridDelegate; this.childrenDelegate = new SliverChildBuilderDelegate( itemBuilder, childCount: itemCount, addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries ); }
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, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, float?cacheExtent = null, List <Widget> children = null ) : base( key: key, scrollDirection: scrollDirection, reverse: reverse, controller: controller, primary: primary, physics: physics, shrinkWrap: shrinkWrap, padding: padding, cacheExtent: cacheExtent ) { D.assert(gridDelegate != null); this.childrenDelegate = new SliverChildListDelegate( children ?? new List <Widget>(), addAutomaticKeepAlives: addAutomaticKeepAlives, addRepaintBoundaries: addRepaintBoundaries ); }
protected ScrollPhysics buildParent(ScrollPhysics ancestor) { if (this.parent == null) { return(ancestor); } return(this.parent.applyTo(ancestor) ?? ancestor); }
public override ScrollPosition createScrollPosition(ScrollPhysics physics, ScrollContext context, ScrollPosition oldPosition) { return(new _FixedExtentScrollPosition( physics: physics, context: context, initialItem: this.initialItem, oldPosition: oldPosition )); }
public override ScrollPosition createScrollPosition(ScrollPhysics physics, ScrollContext context, ScrollPosition oldPosition) { return(new _PagePosition( physics: physics, context: context, initialPage: this.initialPage, keepPage: this.keepPage, viewportFraction: this.viewportFraction, oldPosition: oldPosition )); }
public TestScrollPositionWithSingleContext( ScrollPhysics physics = null, ScrollContext context = null, float?initialPixels = 0.0f, bool keepScrollOffset = true, ScrollPosition oldPosition = null, string debugLabel = null ) : base(physics: physics, context: context, keepScrollOffset: keepScrollOffset, oldPosition: oldPosition, debugLabel: debugLabel) { }
public virtual ScrollPosition createScrollPosition( ScrollPhysics physics, ScrollContext context, ScrollPosition oldPosition ) { return(new ScrollPositionWithSingleContext( physics: physics, context: context, initialPixels: this.initialScrollOffset, keepScrollOffset: this.keepScrollOffset, oldPosition: oldPosition, debugLabel: this.debugLabel )); }