amazon-cognito-identity-dart-2
amazon-cognito-identity-dart-2 copied to clipboard
Null Safety error
Hi, I'm trying to use the package for AWS API gateway and lambda function, but I'm getting a null safety error from the package itself, I'm using the last version of it and getting the following error when launching the app:
Hello, Is your app a null safety?
Yes, it is
Please add flutter doctor -v
results
hey, i was able to make it work, inserting null checks in the source code on these two variables: headers![x_amz_date] = datetime; headers![x_amz_security_token] = awsSigV4Client.sessionToken;
so i changed both to be like this: headers![x_amz_date] = datetime!; headers![x_amz_security_token] = awsSigV4Client.sessionToken!;
since the only problem was the null safety, this did the work, can you check?
could you please point the lines in the file? It seems like all is null safe. https://github.com/furaiev/amazon-cognito-identity-dart-2/blob/main/lib/sig_v4.dart
The headers are declared as Map<String, String?>? headers;
so the values can be nullable.
yes, so, the lines that were returning the problem was 84 and 91, I think the problem was on the const amz_date and const amz_security_token, I think because they are both const, they could still return null but the other variables are on null safety, so when i added the null check with the "!" this solved the problem. I think that's what was happening
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.