Last active
July 27, 2020 20:18
-
-
Save lesliearkorful/049fbc12fb778cb09b25418d5d648005 to your computer and use it in GitHub Desktop.
Pin-point the offset height of an item in a 3-width grid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
int listLength = 24; | |
int index = 5; | |
int h = (listLength * 66) ~/ 3; | |
int col = index % 3; | |
print('find index: $index'); | |
print('gridHeight: $h'); | |
print('rows : ${h / 66}'); | |
print('column : ${col + 1}'); | |
print('row height: ${((((index - 1) * 66) / 3) + 88) - (col * 22)}'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment