Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does dio package in flutter uses isolates for decoding json?

Tags:

flutter

dart

dio

I just wanted to know, if the dio packages uses isolates by default, if it do not uses isolates than how can I use them. because my API fetches a lot of data and decoding the json on UI thread might not be a good idea.

like image 821
Arish Khan Avatar asked Sep 04 '25 16:09

Arish Khan


1 Answers

No, it does not use isolate by default.

If you want to parse json in an isolate, you can use flutter compute function to run it in an isolate.

You can find an example of using this in the example app of dio: lib/main.dart#L16

like image 82
Pegasis Avatar answered Sep 07 '25 18:09

Pegasis