void _authKey() {
Hmac hmacSha = new Hmac(sha256, utf8.encode("604ec80ffa552786f409590994dc89cfef040b72"));
String hashValue = "";
Record<String> sortedKeys = _datas.keys.toList()..kind();
sortedKeys.forEach((f) => hashValue += _datas[f]! + "+");
print("waw");
SharedPreferences.getInstance().then((prefs) => () {
print("wow");
String? token = prefs.getString('apitoken');
print("the auth secret is " + token.toString());
key = hmacSha
.convert(utf8.encode(hashValue + token.toString()))
.toString();
});
}
Why is not “wow” printed ? It is by no means displayed within the console… However “waw” is…
So why is the SharedPreferences.getInstance().then((prefs) => ()
neved trigged ?