Hi Jermaine, I faced a small problem while re-doing your tutorial. Even though this worked the first time, now the code in the server.dart file is giving weird result. Apparently the payload in the request is being converted wrongly:
String data = await request.transform(Utf8Decoder()).join();
var data = Uri.splitQueryString(payload);
/* Prints this:
As you can see, Uri.splitQueryString is making the whole payload the key of the map it returns. I did fix the problem by using json.decode() method, but can you kindly explain what is happening here?
Hey Ratul, the snippet you're providing looks different. You have String data instead of String payload. What does your code for the section in question look like?
I think I misused a function down the line and this happened. I reverted everything back and rewrote the signin handler and it fixed the issue. I was trying out posting JSON data instead of form data and may have used a wrong method.
Oh and I just renamed payload to data for my convenience.
Thanks for the reply :D Eagerly waiting for the third part of the series!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.