isNotLast method

bool isNotLast(
  1. T item
)

Return true if the given item is NOT the same (by identity) as the last iterable item. If this iterable is empty, always return null. This is useful for non-indexed loops where you need to know when you don't have the last item. For example:

for (student in students) {
   if (children.isNotLast(student) result.add(Divider());
   result.add(Text(student.name));
}

Implementation

bool isNotLast(T item) => !isLast(item);