|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public abstract class SliverMultiBoxAdaptorWidget : RenderObjectWidget { |
|
|
|
public abstract class SliverWithKeepAliveWidget : RenderObjectWidget { |
|
|
|
/// Initializes fields for subclasses.
|
|
|
|
public SliverWithKeepAliveWidget(Key key = null) : base(key: key) { |
|
|
|
} |
|
|
|
|
|
|
|
public abstract override RenderObject createRenderObject(BuildContext context); |
|
|
|
} |
|
|
|
|
|
|
|
public abstract class SliverMultiBoxAdaptorWidget : SliverWithKeepAliveWidget { |
|
|
|
protected SliverMultiBoxAdaptorWidget( |
|
|
|
Key key = null, |
|
|
|
SliverChildDelegate del = null |
|
|
|
|
|
|
float trailingScrollOffset |
|
|
|
) { |
|
|
|
return base.estimateMaxScrollOffset( |
|
|
|
constraints, |
|
|
|
firstIndex, |
|
|
|
lastIndex, |
|
|
|
leadingScrollOffset, |
|
|
|
trailingScrollOffset |
|
|
|
) ?? gridDelegate.getLayout(constraints) |
|
|
|
.computeMaxScrollOffset(del.estimatedChildCount ?? 0); |
|
|
|
constraints, |
|
|
|
firstIndex, |
|
|
|
lastIndex, |
|
|
|
leadingScrollOffset, |
|
|
|
trailingScrollOffset |
|
|
|
) ?? gridDelegate.getLayout(constraints) |
|
|
|
.computeMaxScrollOffset(del.estimatedChildCount ?? 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
_childElements.Remove(index); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// processElement may modify the Map - need to do a .toList() here.
|
|
|
|
_childElements.Keys.ToList().ForEach(action: processElement); |
|
|
|
if (_didUnderflow) { |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return widget.estimateMaxScrollOffset( |
|
|
|
constraints, |
|
|
|
firstIndex, |
|
|
|
lastIndex, |
|
|
|
leadingScrollOffset, |
|
|
|
trailingScrollOffset |
|
|
|
) ?? _extrapolateMaxScrollOffset( |
|
|
|
firstIndex, |
|
|
|
lastIndex, |
|
|
|
leadingScrollOffset, |
|
|
|
trailingScrollOffset, |
|
|
|
childCount.Value |
|
|
|
); |
|
|
|
constraints, |
|
|
|
firstIndex, |
|
|
|
lastIndex, |
|
|
|
leadingScrollOffset, |
|
|
|
trailingScrollOffset |
|
|
|
) ?? _extrapolateMaxScrollOffset( |
|
|
|
firstIndex, |
|
|
|
lastIndex, |
|
|
|
leadingScrollOffset, |
|
|
|
trailingScrollOffset, |
|
|
|
childCount.Value |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public int? childCount { |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class KeepAlive : ParentDataWidget<SliverMultiBoxAdaptorWidget> { |
|
|
|
public class KeepAlive : ParentDataWidget<SliverWithKeepAliveWidget> { |
|
|
|
public KeepAlive( |
|
|
|
Key key = null, |
|
|
|
bool keepAlive = true, |
|
|
|
|
|
|
return keepAlive; |
|
|
|
} |
|
|
|
|
|
|
|
public override Type debugTypicalAncestorWidgetClass { |
|
|
|
get => typeof(SliverWithKeepAliveWidget); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |