title: What do the curly brackets do in a Dart constructor?
body: <p>I copied the basic structure of this code from a demo, and have adjusted it for my own needs (and reduced it for this question). </p>
  
  <p>But I'm confused by a couple of things. Perhaps a Dart expert can enlighten me...</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  // Show policy widget - shows 
  class ShowPolicy extends StatelessWidget {
    final Policy policy;
  
    ShowPolicy(this.policy);
  
    @override
    Widget build(BuildContext context) {
      return Text('Test text ' + policy.riskName + ' ' + policy.policyNumber);
    }
  }
  
  // Policy class
  class Policy {
    final String riskName;
    final String policyNumber;
  
    Policy( { this.riskName, this.policyNumber } );
  }
  
  // what is this variable doing here?. Shouldn't it be an a class?
  List&lt;Policy&gt; allPolicies = [
    Policy(riskName: 'Lilly', policyNumber: 'PY123456-4'),
    Policy(riskName: 'Lilly', policyNumber: 'PY123456-3'),
    Policy(riskName: 'Lilly', policyNumber: 'PY123456-2'),
    Policy(riskName: 'Farnesbarnes', policyNumber: 'PY123647-1')
  ];
  </code></pre>
  
  <p>So basically <code>ShowPolicy</code> returns a text widget. It has a constructor that accepts a <code>Policy</code> object. 
  The <code>Policy</code> class contains 2 member variables, <code>riskName</code> and <code>policyNumber</code>.</p>
  
  <p>My question(s) are :-</p>
  
  <p>What owns the <code>allPolicies</code> variable declared at the end? Why is it allowed here and why doesn't it have to be declared in a class? </p>
  
  <p>But my main question is:- Why are the <code>Policy</code> class constructor variables wrapped in curly-brackets {} ?  If I remove them, the Policy class still compiles, but now the <code>allPolicies</code> variable doesn't (error message is '2 required arguments expected but 0 found')</p>