Bruno Leroux 0e595cc86d
Fix CarouselView.weighted crashes when initlal viewportDimension is 0.0 (#167628)
## Description

This PR fixes `CarouselView.weigthed` crashes due to given constraints
being zero (which happen, for instance, when viewportDimension is 0.0).
 
At startup, a warm-up frame can be produced before the Flutter engine
has reported the
initial view metrics. As a result, the first frame can be produced with
a size of zero. In the context of CarouselView this leads to some
problems mainly related to division by zero.

Similar to https://github.com/flutter/flutter/pull/167271 which
addressed the same problem for `CarouselView`.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/167621

## Tests

Adds 3 tests.
2025-04-28 09:22:40 +00:00
..
2025-04-25 18:25:16 +00:00