title: flutter: NoSuchMethodError: The getter 'isEmpty' was called on null
body: <p>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:</p>
  <pre><code>try{
     if(profile.message.isEmpty){
        Navigator.of(context).pushNamed(&quot;/home&quot;);
     }else if(profile == null){
        _showDialog(&quot;Please check your internet connection&quot;);
     }else{
        _showDialog(&quot;Please enter valid credentials&quot;);
     }
  }catch(exception){
     print(exception);
  }
  </code></pre>