Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Flutter Web's "compute()" work on it's own thread or web worker, or how does it work?

If I do this, for example:

FutureBuilder(
   initialData: null,
   future: compute(expensiveParsingOperation, data),
   builder: (context, snapshot) {
       if(!snapshot.hasData){
          // This doesn't spin (frozen).  The entire UI is janked until the expensive operation future completes.
          CircularProgressIndicator(); 
        }else {  
             Container(); 
         } 
});

I expected the above to send expensiveParsingOperation function to a web worker or something and not jank the main thread, but this is not what is occurring in my observation.

like image 654
John Evans Avatar asked Jan 13 '20 07:01

John Evans


1 Answers

compute does nothing on the web platform at this time see https://github.com/flutter/flutter/issues/33577

like image 173
SBNTT Avatar answered Nov 15 '22 07:11

SBNTT