Skip to content

Instantly share code, notes, and snippets.

@lesliearkorful
Last active July 27, 2020 20:18
Show Gist options
  • Save lesliearkorful/049fbc12fb778cb09b25418d5d648005 to your computer and use it in GitHub Desktop.
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
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