Repository: flutter/flutter
File: packages/flutter/lib/src/cupertino/picker.dart (Dart)

Code before:
  ) {
    if (children.isEmpty) {
      return super.assembleSemanticsNode(node, config, children);
    }
    final SemanticsNode scrollable = children.first;
    final Map<int, SemanticsNode> indexedChildren = <int, SemanticsNode>{};
    scrollable.visitChildren((SemanticsNode child) {
      assert(child.indexInParent != null);
      indexedChildren[child.indexInParent!] = child;
      return true;
    });
    if (indexedChildren[_currentIndex] == null) {
      return node.updateWith(config: config);
    }
    final String currentLabel = indexedChildren[_currentIndex]!.label;
    // If the current item has an empty label (e.g., wrapped with ExcludeSemantics),
    // don't set any semantics configuration to avoid assertion errors.
    // The semantics system requires that if "value" is empty, "increasedValue"
    // and "decreasedValue" must also be empty, and no increase/decrease actions
    // should be set.
    if (currentLabel.isEmpty) {
      return node.updateWith(config: config);
    }
    config.value = currentLabel;
    final SemanticsNode? previousChild = indexedChildren[_currentIndex - 1];
    final SemanticsNode? nextChild = indexedChildren[_currentIndex + 1];
    // Only set increase/decrease actions if the adjacent item has a non-empty label.
    // Items wrapped with ExcludeSemantics will have empty labels and should not
    // be navigable via accessibility actions.
    if (nextChild != null && nextChild.label.isNotEmpty) {
      config.increasedValue = nextChild.label;
      config.onIncrease = _handleIncrease;
    }
    if (previousChild != null && previousChild.label.isNotEmpty) {
      config.decreasedValue = previousChild.label;
      config.onDecrease = _handleDecrease;
    }
    node.updateWith(config: config);
  }

  @override
  void dispose() {
    super.dispose();
    controller.removeListener(_handleScrollUpdate);
  }
}

class _CupertinoPickerListWheelChildDelegateWrapper implements ListWheelChildDelegate {
  _CupertinoPickerListWheelChildDelegateWrapper(this._wrapped, {required this.onTappedChild});
  final ListWheelChildDelegate _wrapped;
  final void Function(int index) onTappedChild;

Review comment (bug):
same here, for the ExludesSemantics, they shouldn't be in the in indexedChildren I think? is the `ExludesSemantics` wrapped in the wrong level? 

Code after:
  ) {
    if (children.isEmpty) {
      return super.assembleSemanticsNode(node, config, children);
    }
    final SemanticsNode scrollable = children.first;
    final indexedChildren = <int, SemanticsNode>{};
    scrollable.visitChildren((SemanticsNode child) {
      assert(child.indexInParent != null);
      indexedChildren[child.indexInParent!] = child;
      return true;
    });
    if (indexedChildren[_currentIndex] == null) {
      return node.updateWith(config: config);
    }
    final String currentLabel = indexedChildren[_currentIndex]!.label;
    // If the current item has an empty label (e.g., wrapped with ExcludeSemantics),
    // don't set any semantics configuration to avoid assertion errors.
    // The semantics system requires that if "value" is empty, "increasedValue"
    // and "decreasedValue" must also be empty, and no increase/decrease actions
    // should be set.
    if (currentLabel.isEmpty) {
      return node.updateWith(config: config);
    }
    config.value = currentLabel;
    final SemanticsNode? previousChild = indexedChildren[_currentIndex - 1];
    final SemanticsNode? nextChild = indexedChildren[_currentIndex + 1];
    // Only set increase/decrease actions if the adjacent item has a non-empty label.
    // Items wrapped with ExcludeSemantics will have empty labels and should not
    // be navigable via accessibility actions.
    if (nextChild != null && nextChild.label.isNotEmpty) {
      config.increasedValue = nextChild.label;
      config.onIncrease = _handleIncrease;
    }
    if (previousChild != null && previousChild.label.isNotEmpty) {
      config.decreasedValue = previousChild.label;
      config.onDecrease = _handleDecrease;
    }
    node.updateWith(config: config);
  }

  @override
  void dispose() {
    super.dispose();
    controller.removeListener(_handleScrollUpdate);
  }
}

class _CupertinoPickerListWheelChildDelegateWrapper implements ListWheelChildDelegate {
  _CupertinoPickerListWheelChildDelegateWrapper(this._wrapped, {required this.onTappedChild});
  final ListWheelChildDelegate _wrapped;
  final void Function(int index) onTappedChild;