I'm getting the below error in my code when I try to display the profile image which is connected through my API. how to resolve this. how to display profile picture correctly.
Invalid argument(s): No host specified in URI file:///
//display profile picture
CircleAvatar(
radius: 18,
child: Image.network(profilePicture, fit: BoxFit.cover,)),
//API integration
List<Map<String, dynamic>>? responseJson;
var response;
getdata() async {
try {
response = await Dio().get(BASE_API + "user/getUserById/" +loginUserData["id"]!);
print("response: $response");
response = json.decode(response.toString());
for(var items in response){
responseJson!.add(items);
}
setState(() {
profilePicture = responseJson![0]["profilePicture"]; // new line added
});
// print(responseJson['data']['userName']);
} catch (e) {
print(e);
}
}