浏览代码

upgrade nested_scroll_view

/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
4c3ed1d3
共有 1 个文件被更改,包括 29 次插入22 次删除
  1. 51
      com.unity.uiwidgets/Runtime/widgets/nested_scroll_view.cs

51
com.unity.uiwidgets/Runtime/widgets/nested_scroll_view.cs


public readonly DragStartBehavior dragStartBehavior;
public static SliverOverlapAbsorberHandle sliverOverlapAbsorberHandleFor(BuildContext context) {
_InheritedNestedScrollView target =
(_InheritedNestedScrollView) context.inheritFromWidgetOfExactType(typeof(_InheritedNestedScrollView));
_InheritedNestedScrollView target = context.dependOnInheritedWidgetOfExactType<_InheritedNestedScrollView>();
() => {
return
"NestedScrollView.sliverOverlapAbsorberHandleFor must be called with a context that contains a NestedScrollView.";
});
() => "NestedScrollView.sliverOverlapAbsorberHandleFor must be called with a context that contains a NestedScrollView."
);
List<Widget> slivers = new List<Widget> { };
List<Widget> slivers = new List<Widget>();
slivers.AddRange(headerSliverBuilder(context, bodyIsScrolled));
slivers.Add(new SliverFillRemaining(
child: new PrimaryScrollController(

}
public override State createState() {
return new _NestedScrollViewState();
return new NestedScrollViewState();
class _NestedScrollViewState : State<NestedScrollView> {
internal SliverOverlapAbsorberHandle _absorberHandle = new SliverOverlapAbsorberHandle();
class NestedScrollViewState : State<NestedScrollView> {
internal readonly SliverOverlapAbsorberHandle _absorberHandle = new SliverOverlapAbsorberHandle();
ScrollController innerController => _coordinator._innerController;
ScrollController outerController => _coordinator._outerController;
_NestedScrollCoordinator _coordinator;

class _InheritedNestedScrollView : InheritedWidget {
public _InheritedNestedScrollView(
Key key = null,
_NestedScrollViewState state = null,
NestedScrollViewState state = null,
Widget child = null
) : base(key: key, child: child) {
D.assert(state != null);

public readonly _NestedScrollViewState state;
public readonly NestedScrollViewState state;
public override bool updateShouldNotify(InheritedWidget _old) {
_InheritedNestedScrollView old = _old as _InheritedNestedScrollView;

class _NestedScrollCoordinator : ScrollActivityDelegate, ScrollHoldController {
public _NestedScrollCoordinator(
_NestedScrollViewState _state,
NestedScrollViewState _state,
ScrollController _parent,
VoidCallback _onHasScrolledBodyChanged) {
float initialScrollOffset = _parent?.initialScrollOffset ?? 0.0f;

this._onHasScrolledBodyChanged = _onHasScrolledBodyChanged;
}
public readonly _NestedScrollViewState _state;
public readonly NestedScrollViewState _state;
ScrollController _parent;
public readonly VoidCallback _onHasScrolledBodyChanged;

float velocity) {
return position.createBallisticScrollActivity(
position.physics.createBallisticSimulation(
velocity == 0 ? (ScrollMetrics) position : _getMetrics(position, velocity),
velocity == 0f ? (ScrollMetrics) position : _getMetrics(position, velocity),
velocity
),
mode: _NestedBallisticScrollActivityMode.inner

public SliverOverlapAbsorber(
Key key = null,
SliverOverlapAbsorberHandle handle = null,
Widget child = null
) : base(key: key, child: child) {
Widget child = null,
Widget sliver = null
) : base(key: key, child: sliver ?? child) {
D.assert(child == null || sliver == null);
this.handle = handle;
}

public class RenderSliverOverlapAbsorber : RenderObjectWithChildMixinRenderSliver<RenderSliver> {
public RenderSliverOverlapAbsorber(
SliverOverlapAbsorberHandle handle,
RenderSliver child = null
RenderSliver child = null,
RenderSliver sliver = null
D.assert(child == null || sliver == null);
this.child = child;
this.child = sliver ?? child;
}
public SliverOverlapAbsorberHandle handle {

scrollExtent: childLayoutGeometry.scrollExtent - childLayoutGeometry.maxScrollObstructionExtent,
paintExtent: childLayoutGeometry.paintExtent,
paintOrigin: childLayoutGeometry.paintOrigin,
layoutExtent: childLayoutGeometry.paintExtent - childLayoutGeometry.maxScrollObstructionExtent,
layoutExtent: Mathf.Max(0, childLayoutGeometry.paintExtent - childLayoutGeometry.maxScrollObstructionExtent),
maxPaintExtent: childLayoutGeometry.maxPaintExtent,
maxScrollObstructionExtent: childLayoutGeometry.maxScrollObstructionExtent,
hitTestExtent: childLayoutGeometry.hitTestExtent,

public SliverOverlapInjector(
Key key = null,
SliverOverlapAbsorberHandle handle = null,
Widget child = null
) : base(key: key, child: child) {
Widget child = null,
Widget sliver = null
) : base(key: key, child: sliver ?? child) {
D.assert(child == null || sliver == null);
this.handle = handle;
}

正在加载...
取消
保存