Returns a preceding element in the index, if out of bounds returns null.
V? previous<V>(List<V> list, int index) { return index == 0 ? null : list[index - 1]; }