I am calling web API and receiving the Profile model as a response. When I am using the below code then it is throwing me an error:
try{
if(profile.message.isEmpty){
Navigator.of(context).pushNamed("/home");
}else if(profile == null){
_showDialog("Please check your internet connection");
}else{
_showDialog("Please enter valid credentials");
}
}catch(exception){
print(exception);
}