title: Defining a custom parameter to a widget in Flutter
body: <p>I'm creating a card widget that will be used to create a list of cards. I want to pass a parameter <code>isLastCard</code> to each card, so that I can increase margin for the last card in the list.</p>
  
  <p>I have the following setup:</p>
  
  <pre><code>class CardsIndex extends StatelessWidget {
  
    Widget _card(context, label, bool isLastCard) {
      const double bottomMargin = isLastCard ? 40.0 : 8.0;
  
      return new Container(
        margin: const EdgeInsets.fromLTRB(12.0, 8.0, 12.0, bottomMargin),
        child: new Row(
            children: &lt;Widget&gt;[
            new Expanded(
                child: new Text(label),
            ),
            ],
        ),
      );
    }
  
    Widget build(BuildContext context) {
      return new Scaffold(
          appBar: new AppBar(
              title: new Text("Cards"),
          ),
          body: new Container(
            child: new Stack(
              children: [
                new Container(
                  child: new ListView(
                    children: &lt;Widget&gt;[
                        _card(context, 'Card 1', false),
                        _card(context, 'Card 2', false),
                        _card(context, 'Card 3', true),
                    ],
                  )
                )
              ],
            ),
          ),
      );
    }
  }
  </code></pre>
  
  <p>This gives me this error in the output, for <code>isLastCard</code> inside the turnary:
  <code>Const variables must be initialized with a constant value.</code></p>
  
  <p>How do I correctly define <code>isLastCard</code> and <code>bottomMargin</code> in the <code>_card</code> widget?</p>
  
  <p>Thanks!</p>