decode function
Implementation
Future<DecodeData> decode(Uint8List data, int orientation) async {
final JSObject decoded = await promiseToFuture(_decode(data, orientation));
final rgbaData = decoded.getProperty('data'.toJS) as List<dynamic>;
final durations = decoded.getProperty('durations'.toJS) as List<dynamic>;
return DecodeData(
data: Uint8List.fromList(rgbaData.cast<int>()),
durations: Uint32List.fromList(durations.cast<int>()),
width: decoded.getProperty('width'.toJS) as int,
height: decoded.getProperty('height'.toJS) as int,
);
}