Yes ced gave the solution but to make it work with flutter the trick is to give an object instead of a string :
var kk = {'__class__': 'bytes', 'base64': value};
instead of :
String kk = "{'__class__': 'bytes', 'base64':" + value+ "}";
With a string value I had the same error message :
Unicode-objects must be encoded before hashing