withIndex() operator for
Flow wraps each upstream item in an
object and emits that downstream.
IndexedValue holds the item (
with the zero-based index representing which item this was (
index). This is
useful in cases where you might need to take action based on index, such
as alternating background colors.