use_is_even_rather_than_modulo (#68301)
This commit is contained in:
committed by
GitHub
parent
3393566b56
commit
c0176c9ee5
@@ -111,7 +111,7 @@ class ComplexLayoutState extends State<ComplexLayout> {
|
||||
key: const Key('complex-scroll'), // this key is used by the driver test
|
||||
controller: ScrollController(), // So that the scroll offset can be tracked
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
if (index % 2 == 0)
|
||||
if (index.isEven)
|
||||
return FancyImageItem(index, key: PageStorageKey<int>(index));
|
||||
else
|
||||
return FancyGalleryItem(index, key: PageStorageKey<int>(index));
|
||||
|
||||
Reference in New Issue
Block a user