title: flutter Text exception - expression is not a valid compile-time constant
body: <p>I'm trying to understand the <code>List</code> <a href="https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/demo/material/list_demo.dart" rel="noreferrer">example</a> in <a href="https://github.com/flutter/flutter/tree/master/examples/flutter_gallery" rel="noreferrer">flutter_gallery</a>.
  My approach is to simplify the `` code by refactoring into (<a href="https://github.com/jeffhongxiao/flutter_gallery_material_list" rel="noreferrer">my project</a>).</p>
  
  <p>I'm seeing a breaking change in <a href="https://github.com/jeffhongxiao/flutter_gallery_material_list/commit/c6c13e5f8e98305aa7c30126a894e295876e5b65" rel="noreferrer">this commit</a></p>
  
  <pre><code>I/flutter (14712): 'file:///Users/hong/Flutter/github/flutter_gallery_material_list/lib/main.dart': error: line 54:
  I/flutter (14712): expression is not a valid compile-time constant
  I/flutter (14712):     const Text t = const Text(text);
  </code></pre>
  
  <p>The source code starting line 53 is:</p>
  
  <pre><code>  MergeSemantics _mergeSemanticsOf(String text, _MaterialListType listType) {
      const Text t = const Text(text);
      //const Text t = const Text('we want a variable here');
      return new MergeSemantics(
        child: new ListTile(
            dense: true,
            title: t,
            trailing: new Radio&lt;_MaterialListType&gt;(
              value: listType,
              groupValue: _itemType,
              onChanged: changeItemType,
            )),
      );
    }
  </code></pre>
  
  <p>I can only make it compile with something like:
  <code>const Text t = const Text('we want a variable here');</code>.</p>
  
  <p>I understand what the exception says, but wonder if there is a way to pass a variable to Text().</p>
  
  <p>This is the exception popup (in a red box) in VSCode:
  <a href="https://i.stack.imgur.com/XzPQO.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/XzPQO.jpg" alt="enter image description here"></a></p>
  
  <p>And this is the exception on an Android phone (Samsung S7)
  <a href="https://i.stack.imgur.com/Vnjs5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Vnjs5.png" alt="enter image description here"></a></p>
  
  <p>A search on Stackoverflow shows <a href="https://stackoverflow.com/questions/29113434/symbol-with-private-identifier-argument">this</a>, which looks not related to my question.</p>