skip to Main Content

type 'Null' is not a subtype of type 'String' – Flutter

i am getting this error in login fuction void _login() async { var user = LoginUser( emailId: _emailController.text, password: _passwordController.text, ); try { CustomerLoginResponse response = await ApiManager().loginUser(user).catchError((err) { return Future<CustomerLoginResponse>.error(err); }); if (response.successful) { showDataAlert(); print(response.message); } else {…

VIEW QUESTION

Mongodb – okhttp not sending header on post request

I am trying to send a simple post request to MongoDB using okhttp. Here is the code that I am working with: try { String jsonStr = om.writeValueAsString(postRequest); RequestBody body = RequestBody.create( jsonStr, MediaType.parse("application/json; charset=utf-8")); // also attempted with MediaType.parse("application/json")…

VIEW QUESTION
Back To Top
Search