title: NoSuchMethodError The method '[]' was called on null. Tried calling: []("forecastday")
body: <p>This is the code `</p>
  <pre class="lang-dart prettyprint-override"><code>class WeatherModel {
    String date;
    double temp;
    double maxTemp;
    double minTemp;
    String weatherStateName;
  
    WeatherModel(
        {required this.date,
        required this.temp,
        required this.maxTemp,
        required this.minTemp,
        required this.weatherStateName});
  
    factory WeatherModel.fromJson(dynamic data) {
      var jsonData = data['forecast']['forecastday'][0]['day'];
      
  
      return WeatherModel(
          date: data['location']['localtime'];
          temp: jsonData['avgtemp_c'];
          maxTemp: jsonData['maxtemp_c'];
          minTemp: jsonData['mintemp_c'];
          weatherStateName: jsonData['condition']['text']);
    }
  
    @override
    String toString() {
      return 'tem = $temp minTemp = $minTemp date = $date';
    }
  }
  </code></pre>
  <p>this image</p>
  <p><img src="https://i.stack.imgur.com/kRemv.png" alt="1" /></p>
  <p><img src="https://i.stack.imgur.com/VLpfQ.png" alt="2" /></p>
  <p>this is an error message.</p>
  <p>The method '[]' was called on null.
  Tried calling: .</p>