Qun Cheng 173bf86b7b
Fix CarouselView rebuild (#152791)
Fixes https://github.com/flutter/flutter/issues/152787

Originally, when we want to update `itemExtent`, we didn't check if the old itemExtent is null but `getItemFromPixels()` needs that information.
https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/carousel.dart#L1343-L1347
Then in `getItemFromPixels()`, it goes to the else statement which assert `flexWeights` is not null, then the exception happens.

- [x ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
2024-08-05 23:04:48 +00:00
..