Error: Bad state: No element in flutter code example
Example: StateError (Bad state: No element)
// Use the orElse and set it to null.
someIterable.firstWhere(test, orElse: () => null);
// Use the orElse and set it to null.
someIterable.firstWhere(test, orElse: () => null);