title: Difference between class constructor syntax in Dart
body: <p>I have a class that I am creating that looks like this:</p>
  
  <pre><code>class Movie {
    final String title, posterPath, overview;
  
    Movie(this.title, this.posterPath, this.overview);
  
    Movie.fromJson(Map json) {
      title = json["title"];
      posterPath = json["poster_path"];
      overview = json['overview';
    }
  }
  </code></pre>
  
  <p>I am getting a warning that says that "The final variables 'overview', 'posterPath', &amp; '1' more must be initialized. There are also warnings around each variable saying 'title' can't be used as a setter because it is final.</p>
  
  <p>When I write the constructor using this syntax, the warnings go away:</p>
  
  <pre><code>Movie.fromJson(Map json)
     : title = json["title"],
       posterPath = json["poster_path"],
       overview = json['overview'];
  </code></pre>
  
  <p>What exactly is going on here?</p>