title: Flutter: Using an array of Stateful Widgets inside a Stateful Widget causes a 'A RenderFlex overflow'
body: <p>Im learning Flutter and I came across this strange behaviour while building a simple app. I've created a custom Stateful Widget and I simply can't use it inside another Stateful Widget. Is it the expected behaviour or I'm missing something here?</p>
  
  <p>The errors are: </p>
  
  <blockquote>
    <p>The following NoSuchMethodError was thrown building
    MediaQuery(MediaQueryData(size: Size(375.0,
        812.0), devicePixelRatio: 3.0, textScaleFactor: 1.0, padding: EdgeInsets(0.0, 0.0, 0.0, 34.0),
        viewInsets: EdgeInsets.zero, alwaysUse24HourFormat: false)):
        The method '_debugTypesAreRight' was called on null.
        Receiver: null
        Tried calling: _debugTypesAreRight(Instance of 'TextCard')</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>Another exception was thrown: The _ScaffoldLayout custom multichild
    layout delegate forgot to lay out the following child:</p>
  </blockquote>
  
  <p>The code:</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(new MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return new MaterialApp(
        title: 'Stateful Widget 02',
        theme: new ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: new MyHomePage(),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    MyHomePage({Key key}) : super(key: key);
  
  
    @override
    _MyHomePageState createState() =&gt; new _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
  
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
        appBar: new AppBar(
          title: new Text('Testing nested Stateful Widgets'),
        ),
        body: new Center(
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: &lt;Widget&gt;[
              new TextCard(),
              new TextCard()
            ],
          ),
        ),
      );
    }
  }
  
  
  class TextCard extends StatefulWidget {
    @override
    State&lt;StatefulWidget&gt; createState() {
      _TextCardState createState() =&gt; new _TextCardState();
    }
  }
  
  class _TextCardState extends State&lt;TextCard&gt; {
  
    @override
    Widget build(BuildContext context) {
      return new Card(
          child: new Text('12312')
      );
    }
  }
  </code></pre>