Can I call a non-async function asynchronously in Dart? -
I want to decode a GIF with the use of decodgefnimation, but it takes a lot of time and freeze my webplay Causes to do There are no async methods in the library. I saw how to do asynchronous processing in dart, and it seems that I need to use futures, though I'm not sure how to make one for my function.
Actually it is not sure what I am doing
zero decode (Uint8List data) {future animation = decodeGifAnimation (Data); // But it gives the animation, not the future! Anim.then (ready); }
"zero-decoded" Data) {new futures (() => decodegraph animation (data)). Then (prepayer); }
or
future decode (Uint8List data) {new future (= =)> decodeGifAnimation (Data)) then (prepeare). }
If you want to do some async processing, then the method comes back to call like the method
decode (data) then (xxx);
Comments
Post a Comment