title: "Expected an Identifier" and "Expected to find ')'" for-each errors in Flutter
body: <p>I am getting &quot;Expected an Identifier&quot; and &quot;Expected to find ')'&quot; errors in my code while using a for-each loop in flutter, here is the code at the loop</p>
  <pre><code>body: ListView(
        for(String item in groceryListNames){
          ListTile(
            title: &quot;$item&quot;,    
            onPressed: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) =&gt; GroceryListPage()),
              );
            },
          ),
        },
      ),
  </code></pre>
  <p>Basically, it's supposed to open a new page from a function called GroceryListPage() when pressing the items in the loop, but the loop is giving me the errors above. Here is the entire function:</p>
  <pre><code>class _ListsPageState extends State&lt;ListsPage&gt;with SingleTickerProviderStateMixin {
    Widget build(BuildContext context) {
      return Scaffold(
          appBar: AppBar(title: Text(&quot;Grocery Lists&quot;)),
          drawer: AppDrawer(),
          body: ListView(
            for(String item in groceryListNames){
              ListTile(
                title: &quot;$item&quot;,
                
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(builder: (context) =&gt; GroceryListPage()),
                  );
                },
              ),
            },
          ),
      );
    }
  
  }
  </code></pre>