|
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using Unity.UIWidgets.foundation; |
|
|
|
using Unity.UIWidgets.gestures; |
|
|
|
using Unity.UIWidgets.painting; |
|
|
|
using Unity.UIWidgets.rendering; |
|
|
|
using Unity.UIWidgets.ui; |
|
|
|
|
|
|
void createChild(int index); |
|
|
|
void createChild(int index); |
|
|
|
void removeChild(RenderBox child); |
|
|
|
void removeChild(RenderBox child); |
|
|
|
float estimateMaxScrollOffset( |
|
|
|
float estimateMaxScrollOffset( |
|
|
|
SliverConstraints constraints, |
|
|
|
int? firstIndex = null, |
|
|
|
int? lastIndex = null, |
|
|
|
|
|
|
|
|
|
|
int childCount { get; } |
|
|
|
int childCount { get; } |
|
|
|
void didAdoptChild(RenderBox child); |
|
|
|
void didAdoptChild(RenderBox child); |
|
|
|
void setDidUnderflow(bool value); |
|
|
|
void setDidUnderflow(bool value); |
|
|
|
void didStartLayout(); |
|
|
|
void didStartLayout(); |
|
|
|
void didFinishLayout(); |
|
|
|
void didFinishLayout(); |
|
|
|
bool debugAssertChildListLocked(); |
|
|
|
bool debugAssertChildListLocked(); |
|
|
|
} |
|
|
|
|
|
|
|
public class SliverVariableSizeBoxAdaptorParentData : SliverMultiBoxAdaptorParentData |
|
|
|
|
|
|
|
|
|
|
public override void attach(object o) |
|
|
|
{ |
|
|
|
base.attach(owner); |
|
|
|
if (o is PipelineOwner) |
|
|
|
if (o is PipelineOwner ownerIn) |
|
|
|
_keepAliveBucket.Values.ToList().ForEach((child) => child.attach(owner)); |
|
|
|
base.attach(ownerIn); |
|
|
|
_keepAliveBucket.Values.ToList().ForEach((child) => child.attach(ownerIn)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
constraints.axisDirection, constraints.growthDirection)) |
|
|
|
{ |
|
|
|
case AxisDirection.up: |
|
|
|
mainAxisUnit = new Offset (0, -1); |
|
|
|
crossAxisUnit = new Offset (1, 0); |
|
|
|
mainAxisUnit = new Offset(0, -1); |
|
|
|
crossAxisUnit = new Offset(1, 0); |
|
|
|
mainAxisUnit = new Offset (1, 0); |
|
|
|
crossAxisUnit = new Offset (0, 1); |
|
|
|
mainAxisUnit = new Offset(1, 0); |
|
|
|
crossAxisUnit = new Offset(0, 1); |
|
|
|
mainAxisUnit = new Offset (0, 1); |
|
|
|
crossAxisUnit = new Offset (1, 0); |
|
|
|
mainAxisUnit = new Offset(0, 1); |
|
|
|
crossAxisUnit = new Offset(1, 0); |
|
|
|
mainAxisUnit = new Offset (-1, 0); |
|
|
|
crossAxisUnit = new Offset (0, 1); |
|
|
|
mainAxisUnit = new Offset(-1, 0); |
|
|
|
crossAxisUnit = new Offset(0, 1); |
|
|
|
foreach (var child in children) { |
|
|
|
foreach (var child in children) |
|
|
|
{ |
|
|
|
float? mainAxisDelta = childMainAxisPosition(child); |
|
|
|
float? crossAxisDelta = childCrossAxisPosition(child); |
|
|
|
Offset childOffset = new Offset( |
|
|
|
|
|
|
{ |
|
|
|
base.debugFillProperties(properties); |
|
|
|
properties.add(DiagnosticsNode.message(childCount > 0 |
|
|
|
? $"currently live children: ${string.Join(", ", indices)}" |
|
|
|
? $"currently live children: ${string.Join(", ", indices)}" |
|
|
|
: "no children current live")); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
if (childCount > 0) |
|
|
|
{ |
|
|
|
foreach (var child in |
|
|
|
children) { |
|
|
|
children) |
|
|
|
{ |
|
|
|
var childParentData = |
|
|
|
child.parentData as SliverVariableSizeBoxAdaptorParentData; |
|
|
|
childList.Add(child.toDiagnosticsNode( |
|
|
|
|
|
|
if (_keepAliveBucket.isNotEmpty()) |
|
|
|
{ |
|
|
|
List<int> indices = _keepAliveBucket.Keys.ToList(); |
|
|
|
indices.Sort(); |
|
|
|
foreach (var index in indices) { |
|
|
|
indices.Sort(); |
|
|
|
foreach (var index in indices) |
|
|
|
{ |
|
|
|
childList.Add(_keepAliveBucket[index].toDiagnosticsNode( |
|
|
|
name: $"child with index {index} (kept alive offstage)", |
|
|
|
style: DiagnosticsTreeStyle.offstage |
|
|
|