latest method

List<Map<T, T>> latest([
  1. String key = 'id'
])

Returns a list of maps sorted by the given key in descending order.

By default, it sorts by the 'id' key.

Example:

final latestItems = list.latest("timestamp");

Implementation

List<Map<T, T>> latest([String key = 'id']) => sortBy(key, isDesc: true);