📅  最后修改于: 2022-03-11 14:55:01.826000             🧑  作者: Mango
/// Find a person in the list using indexWhere method.
void findPersonUsingIndexWhere(List people,
String personName) {
// Find the index of person. If not found, index = -1
final index = people.indexWhere((element) =>
element.name == personName);
if (index >= 0) {
print('Using indexWhere: ${people[index]}');
}
}