Fix SplitPane RangeError when child count changes between rebuilds (#9822)

* Fix SplitPane RangeError when child count changes between rebuilds

Fixes #9648.

SplitPane cached its fractions list in initState only. When the parent
rebuilt the widget with a different number of children (for example,
toggling a panel via a collection-if), fractions.length stayed at the
old value while widget.minSizes and widget.children shrank, causing
minSizeForIndex to read past the end of widget.minSizes and throw
'RangeError (index): Index out of range: index should be less than 2: 2'
from the layout pass.

This adds didUpdateWidget to _SplitPaneState. When the child count
changes, fractions is reset to List.of(widget.initialFractions) so it
stays in sync with the new children and minSizes. The existing
constructor assertion already guarantees children.length matches
initialFractions.length.

Bumps devtools_app_shared to 0.5.2 with a CHANGELOG entry, and adds
regression tests that pump a 3-child SplitPane and then a 2-child
SplitPane (and vice versa) and assert no exception is thrown.

* Add release note entry for SplitPane RangeError fix (#9822)

* Address review: bump devtools_app_shared CHANGELOG to 0.5.2-wip

* Address review: bump devtools_app_shared pubspec to 0.5.2-wip
5 files changed
tree: 6197b50c4fce48e0b022fcb6fa6d562e72491446
  1. .agents/
  2. .gemini/
  3. .github/
  4. .vscode/
  5. _markdown_images/
  6. docs/
  7. packages/
  8. third_party/
  9. tool/
  10. .gitattributes
  11. .gitignore
  12. AGENTS.md
  13. analysis_options.yaml
  14. AUTHORS
  15. BETA_TESTING.md
  16. CLAUDE.md
  17. CODE_OF_CONDUCT.md
  18. CODEOWNERS
  19. CONTRIBUTING.md
  20. DEBUGGING.md
  21. devtools_options.yaml
  22. DOCUMENTATION.md
  23. flutter-candidate.txt
  24. LICENSE
  25. pubspec.lock
  26. pubspec.yaml
  27. README.md
  28. STYLE.md
  29. TESTING.md
  30. TRIAGE.md
README.md

Dart & Flutter DevTools

Build Status OpenSSF Scorecard

What is this?

Dart & Flutter DevTools is a suite of performance tools for Dart and Flutter.

Getting started

For documentation on installing and trying out DevTools, please see our docs.

Contributing and development

Contributions welcome! See our contributing page for an overview of how to build and contribute to the project.

Terms and Privacy

By using Dart DevTools, you agree to the Google Terms of Service. To understand how we use data collected from this service, see the Google Privacy Policy.