xxxxxxxxxx
The mistake was stupid. I did not convert the controller to text. I directly did from controller ==> String. I am keeping this question just in case anybody else has a similar query.
xxxxxxxxxx
double a = 100.90;
int.parse(a.toString()); // throws error
int.parse(a.floor().toString()); // works
xxxxxxxxxx
// for Flutter, you need two parameters, in first you need to enter domain, and in second pass the subroute
var response =
await http.get(Uri.https('favqs.com', '/api/quotes/4'), headers: {
'Content-Type': 'application/json',
'Authorization': "Token token='xxxxxxxxxxxxxxxx'",
});
xxxxxxxxxx
//For Flutter/Dart/Firebase
Remove the https:// from the URL address.
If you need keep the https:// in your string for some reason,
replace Uri.https to Uri.parse