Executing Heavy Tasks Without Blocking the Main Thread on Flutter

Written by altynberg | Published 2020/12/15
Tech Story Tags: flutter | flutter-tutorial | flutter-app-development | application | mobile-app-development | iphone | react-native | native

TLDROn Flutter everything runs on a single (main) isolate and executes only one operation at a time. This means while your app is doing strenuous work, you will lose the interaction and the UI will freeze. We can create new isolates and do the heavy work there, but every isolate can reach only its own memory, and if you have to use a large set of data it won't be very optimal because we have to copy the large data from one isolate to another, and it can still block the main isolate while doing that. Every situation requires a different approach but in most cases we can solve them on the main isolate using an event queue optimally. Let me show you one of these approaches.via the TL;DR App

no story

Written by altynberg | Software Engineer
Published by HackerNoon on 2020/12/15