Summary
In this chapter, we learned about a complex yet very important concept in modern-day application programming – concurrent programming and its peculiarities in Dart. We explored the inner workings of the asynchronous API in Dart called Future, as well as learned practical tips and tricks on how to write asynchronous code efficiently. We also observed various approaches to error handling when dealing with Futures. Number crunching, background tasks, serializing big chunks of data – all of these actions can take so much time that they will end up blocking the main thread, inevitably resulting in degraded app performance. Thankfully, you now know how to solve problems when asynchronicity is not enough by using parallelism via isolates and the convenient compute
function.
In the next chapter, we will learn best practices for another set of crucial tasks in app development with Flutter – how to communicate with the underlying native platforms efficiently.
...