void decode(Uint8List data) {
new Future(() => decodeGifAnimation(data)).then(prepeare);
}
or
Future decode(Uint8List data) {
return new Future(() => decodeGifAnimation(data)).then(prepeare);
}
if you want to do some async processing when the method returns to call the method like
decode(data).then(xxx);