0
votes

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

1 Answers

1
votes

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

 Map result = response.data;
 print(result['message']);