use_is_even_rather_than_modulo (#68301)

This commit is contained in:
Alexandre Ardhuin
2020-10-16 20:20:00 +02:00
committed by GitHub
parent 3393566b56
commit c0176c9ee5
22 changed files with 30 additions and 30 deletions

View File

@@ -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));