David Gonzalez
May 17, 2024

--

It's a little bit complex to unwrap values: "final (((a, b), c), d)". You need to remember order and if you return the zipped Future, it may lead to unmaintainable code.

I suggest that API :

final (a, b, c) = await futureA.zipWith(futureB).zipWith(futureC)

But in that case, it's same as:

final (a, b, c) = Future.wait([futureA, futureB, futureC]);

So I'm not sure zipWith is relevant...

--

--

David Gonzalez
David Gonzalez

Written by David Gonzalez

Hi, I’m David, a french mobile applications developer. As a freelance, I work on Android and iOS applications since 2010. I also work on Flutter now !

No responses yet