-
Gildásio Filho authored
The documentation for using `findChildIndexCallback` recommends using `indexOf`, but that causes [this line](https://github.com/flutter/flutter/blob/05259ca938c9ea27aa551048b690d5a06371a6c0/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart#L259) to throw in debug mode, and when using `SliverList`, it breaks the render. This PR changes the usage to check if the index is not negative before using it, and changes to return `null` instead if the child wasn't able to be found. There's the related issue #107123, but this doesn't actually fix it. ----- This PR has been updated to add the snippets that were used in the `findChildIndexCallback` comment as examples with proper tests, as well as updating the comment to reference the new examples.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
page_view.0_test.dart | ||
page_view.1_test.dart |