Skip to content

355 - FlatThen on Future in Dart

Compare
Choose a tag to compare
@vandadnp vandadnp released this 14 Sep 04:54
· 86 commits to main since this release
fcaac9a

If you have a Future<Iterable> and want to use "then()" on it, you will end up with the Iterable which you might need to map manually inside the "then()" function which results in a function call inside another function call, potentially making your code look more complicated than it should be. Using this extension on Future<Iterable>, you can make this a lot easier to read at call-site. Let me show you how => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/flatthen-on-future-in-dart/flatthen-on-future-in-dart.md