Skip to main content

avoid-nested-streams-and-futures

added in: 1.7.0

Warns when a Stream type contains a Future or vice versa.

Example

❌ Bad:

// LINT
Stream<Future<int>> function() async* {
...
}

Future<Stream<int>> function() async => ...; // LINT

✅ Good:

Stream<int> function() async* {
...
}

Future<int> function() async => ...;