debugDescribeChildren method

  1. @override
List<DiagnosticsNode> debugDescribeChildren()
override

Returns a list of DiagnosticsNode objects describing this node's children.

Children that are offstage should be added with style set to DiagnosticsTreeStyle.offstage to indicate that they are offstage.

The list must not contain any null entries. If there are explicit null children to report, consider DiagnosticsNode.message or DiagnosticsProperty<Object> as possible DiagnosticsNode objects to provide.

Used by toStringDeep, toDiagnosticsNode and toStringShallow.

See also:

Implementation

@override
List<DiagnosticsNode> debugDescribeChildren() {
  final children = <DiagnosticsNode>[];
  for (final popUpList in keys) {
    final list = listOf(popUpList)!;
    if (list.firstChild != null) {
      var child = list.firstChild;
      while (true) {
        final childParentData =
            child!.parentData! as MultiSliverMultiBoxAdaptorParentData;
        children.add(child.toDiagnosticsNode(
            name:
                'child with popup ${popUpList?.debugId} index ${childParentData.index}'));
        if (child == list.lastChild) {
          break;
        }
        child = childParentData.nextSibling;
      }
    }
    final keepAliveBucket = _keepAliveBucket[popUpList];
    if (keepAliveBucket?.isNotEmpty ?? false) {
      final indices = keepAliveBucket!.keys.toList()..sort();
      for (final index in indices) {
        children.add(keepAliveBucket[index]!.toDiagnosticsNode(
          name:
              'child with popup ${popUpList?.debugId} index $index (kept alive but not laid out)',
          style: DiagnosticsTreeStyle.offstage,
        ));
      }
    }
  }
  return children;
}