Dart Iterable  singlewhere().

Dart Iterable singlewhere().

singlewhere()

void main() {
  List<int> numList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  int result = numList.singleWhere((element) => element > 2 && element < 4);
  print(result);
}

output

3

Exited.