No need to copy to a Uint8List here, Zlib.deflate returns a Uint8List; suggested:
ByteBuffer compressed = (Zlib.deflate(data) as Uint8List).buffer.