title: Flutter: Vertical scrolling inside a container
body: <p>How do I add scrolling so that the multiple Text answers are scrollable? I have tried working with SingleChildScrollView but can't get the scrolling to work, the Text answers disappear and the page doesn't scroll.</p>
  
  <pre><code>class Answer extends StatelessWidget {
    final Function selectHandler;
    final String answerText;
  
    Answer(this.selectHandler, this.answerText);
  
    @override
  Widget build(BuildContext context) {
      return Container(
        width: double.infinity,
        margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0),
        child: RaisedButton(
          padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 16.0),
          color: Color(0xfff4f4f4),
          textColor: Color(0xff3a3535),
          child: Text(answerText, style: TextStyle(
              fontFamily: 'VT323', fontSize: 22)),
          onPressed: selectHandler,
        ),
        decoration: BoxDecoration(
          // color: Color.fromARGB(255, 238, 238, 238),
          boxShadow: [
            BoxShadow(offset: Offset(10, 10),color: Color.fromARGB(80, 0, 0, 0),blurRadius: 10),
            BoxShadow(offset: Offset(-10, -10),color: Color.fromARGB(150, 255, 255, 255),blurRadius: 10)
          ],
        ),
      );
    }
  }
  </code></pre>
  
  <p>ListView.builder 
  Here I get the following error:</p>
  
  <p>"type 'String' is not a subtype of type 'List'</p>
  
  <pre><code>class Answer extends StatelessWidget {
    final Function selectHandler;
    final List&lt;String&gt; answerText;
  
    Answer(this.selectHandler, this.answerText);
  
    @override
  Widget build(BuildContext context) {
      return Scaffold(
        body: Container(
          height: 60.0,
          width: double.infinity,
          margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0),
          decoration: BoxDecoration(
            // color: Color.fromARGB(255, 238, 238, 238),
            boxShadow: [
              BoxShadow(
                  offset: Offset(10, 10),
                  color: Color.fromARGB(80, 0, 0, 0),
                  blurRadius: 10),
              BoxShadow(
                offset: Offset(-10, -10),
                color: Color.fromARGB(150, 255, 255, 255),
                blurRadius: 10,
              ),
            ],
          ),
          child: ListView.builder(
            itemBuilder: _buildAnswerItem,
            itemCount: answerText.length,
          ),
        ),
      );
    }
    Widget _buildAnswerItem( BuildContext context, int index) {
      return RaisedButton(
        padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 16.0),
        color: Color(0xfff4f4f4),
        textColor: Color(0xff3a3535),
        child: Text(answerText[index],
            style: TextStyle(fontFamily: 'VT323', fontSize: 22)),
        onPressed: selectHandler,
      );
    }
  }
  </code></pre>