findLastIndex function

int findLastIndex(
  1. List list,
  2. dynamic element
)

This method finds the item in the list from right / last using dart's List.indexOf() method Example

_.findLastIndex(["Jack", "Yash", "Adib", "Adib"], "Adib");
// Returns 0

Implementation

int findLastIndex(List list, dynamic element) {
  return list.reversed.toList().indexOf(element);
}