0

I have a simple response.data that get me {message: You have checked in successfully}

var dio = Dio();
Response response = await dio.get('http://10.0.2.2:4000/');
print(response.data); //{message: You have checked in successfully}

How can I just print out: You have checked in successfully? Using print(response.data.message) will not work.

1 Answer 1

1

Convert your response.data to Map using the below Code,

 Map result = response.data;
 print(result['message']);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.