Advanced Flutter
Q86 / 100

What is the compute() function in Flutter used for?

Correct! Well done.

Incorrect.

The correct answer is B) Running a function in a separate Isolate to offload CPU-intensive work from the UI thread and prevent jank

B

Correct Answer

Running a function in a separate Isolate to offload CPU-intensive work from the UI thread and prevent jank

Explanation

compute() runs a top-level function in a new Isolate and returns a Future with the result. It is used for CPU-intensive work (JSON parsing large payloads, image processing) that would block the main thread and cause UI jank.

Progress
86/100