Commit 3e6912a
Fix CarouselView rebuild (flutter#152791)
Fixes flutter#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].1 parent 93b5595 commit 3e6912a
File tree
2 files changed
+45
-1
lines changed- packages/flutter
- lib/src/material
- test/material
2 files changed
+45
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1340 | 1340 | | |
1341 | 1341 | | |
1342 | 1342 | | |
1343 | | - | |
| 1343 | + | |
1344 | 1344 | | |
1345 | 1345 | | |
1346 | 1346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1149 | 1149 | | |
1150 | 1150 | | |
1151 | 1151 | | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
1152 | 1196 | | |
1153 | 1197 | | |
1154 | 1198 | | |
| |||
0 commit comments