title: Flutter error: Each child must be laid out exactly once. On building layout
body: <p>I'm using flutter_bloc.</p>
  <p>I've got code like this:</p>
  <pre><code>class Settings extends StatelessWidget {
    final _formKey = GlobalKey&lt;FormState&gt;();
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
        appBar: new AppBar(
            title: new Text(&quot;SomeApp&quot;,style: TextStyle(color: Colors.white)),
            automaticallyImplyLeading: false,
            backgroundColor: myBlue.shade50,
  
            actions: &lt;Widget&gt;[
              IconButton(
                icon: new Icon(FontAwesomeIcons.download,color:  Colors.white),
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(builder: (context) =&gt; DownloadView()),
                  );
                },
              ),
              IconButton(
                icon: new Icon(FontAwesomeIcons.chevronCircleLeft,color:  Colors.white),
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(builder: (context) =&gt; MainWindow()),
                  );
                },
              ),]
        ),
        body: Container(
          padding: EdgeInsets.symmetric(vertical: 16),
          alignment: Alignment.center,
          child: new BlocBuilder&lt;SettingsBloc, SettingsState&gt;(
            builder: (context, state) {
              if (state is SettingsNotLoaded) {
                return new Center(
                    child: Text(
                      'count1',
                      style: TextStyle(fontSize: 24.0,color: Colors.black),
                    )
                );
              } else if (state is SettingsLoaded) {  
                return new Center(
                    child: Text(
                      'count2',
                      style: TextStyle(fontSize: 24.0,color: Colors.black),
                    )
                );
              }
              else
                {
                  return new Center(
                      child: Text(
                        'count3',
                        style: TextStyle(fontSize: 24.0,color: Colors.black),
                      )
                  );
                }
            },
          ),
  
        ),
      );
    }
  </code></pre>
  <p>And when starting my app I see the appBar just the way I want, but I do not see any text in body (I should see either count1, count2 or count3), but instead I get the error:</p>
  <blockquote>
  <p>Each child must be laid out exactly once.&quot; referring to line 5 - <code>return new Scaffold(</code></p>
  </blockquote>
  <p>Of course, I looked for info on flutter_bloc page, on <a href="https://flutter.dev/docs/development/ui/layout/tutorial" rel="noreferrer">https://flutter.dev/docs/development/ui/layout/tutorial</a> ,here and in google as well.</p>