Member-only story
Isolates in Flutter | Dart Isolate Tutorial — Run tasks in background using Isolates
In this article we will discuss about when, why and how to use isolates in Flutter apps.
🎥 Video Tutorial
🔭 Implementation
Just like threads what we have in java, we have isolates here in flutter. Each isolate has its own memory where it performs the event looping. So in general isolates are individual worker components that can do the given task without affecting the main dart engine. Since dart language is single threaded, isolates can be used for achieving multi-threading in flutter apps.
So this is what isolate technically is.
Now let’s turn our attention towards the question,
Why do we need to use isolates in our flutter app?
Lets try to answer this question with the help of a simple example. Consider we the basic UI containing a circularProgressIndicator
and Elevated button
widgets placed at the center of our app screen as shown below👇.