findLastIndex function

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

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

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

Implementation

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