title: flutter - The method '[]' was called on null (parse json)
body: <p>how do make a 'Model' with a Json structure like this?
  <a href="https://i.stack.imgur.com/iDLzz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iDLzz.png" alt="see image" /></a></p>
  <p>--
  beforely, I tried parsing json in another form and it worked, and when I tried to make the structure for json above like this:</p>
  <pre><code>class HomeTeam {
    final int id, legacyId, name, countryId;
    final bool nationalTeam;
    final String logoPath;
  
      HomeTeam({this.id, this.legacyId, this.name, this.countryId, this.nationalTeam, this.logoPath});
  
      factory HomeTeam.fromJson(Map&lt;String, dynamic&gt; json){
        return HomeTeam(
            id: json['id'],
            legacyId: json['legacy_id'],
            name: json['name'],
            nationalTeam: json['national_team'],
            logoPath: json['logo_path']
          );
      }
  }
  </code></pre>
  <p>.</p>
  <pre><code>homeTeam: HomeTeam.fromJson(json['localTeam']['data']),
  </code></pre>
  <p>Then the result appears an error..</p>
  <blockquote>
  <p>NoSuchMethodError: The method '[]' was called on null. E/flutter (
  220): Receiver: null E/flutter: Tried calling: </p>
  </blockquote>
  <p>how to solve this problem?</p>