title: Syntax highlighter doesn't expand to show all code
body: <p>I am trying to come up with a code editor which takes input from a text form field and shows the output on a Rich Text widget using DartSyntaxHighlighter.</p>
  
  <p>While it works fine for a short snippet of code, it doesn't show all the code for a larger snippet. Here's what I've done so far : </p>
  
  <pre><code>class CodeEditorWidget extends StatefulWidget {
  
    CodeEditorWidget();
  
    @override
    _ContentWidgetState createState() {
      return _ContentWidgetState();
    }
  }
  
  class _ContentWidgetState extends BaseState&lt;CodeEditorWidget&gt; {
  
    String _currentCode = "";
  
    @override
    void initializeData() {
      _currentCode = "class HelloWorld {\n"
          "public static void main() {\n"
          "System.out.println(\"Hello again\");\n"
          "}\n"
          "}";
      _contentController.addListener(() {
        _currentCode = _contentController.value.text;
        setState(() {
  
        });
      });
    }
  
    @override
    Widget build(BuildContext context) =&gt; _buildContent();
  
    Widget _buildContent() {
      //return _buildBody();
      userState = AppStateWidget.of(context).userState;
      return _buildBody();
    }
  
    Scaffold _buildBody() =&gt; Scaffold(
      key: _scaffoldLoginKey,
      appBar: buildAppBar("Code Editor"),
      body: _buildCodeEditor(),
      floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
      floatingActionButton: _buildFab(),
    );
  
    _buildCodeEditor() =&gt; Card(
      margin: const EdgeInsets.fromLTRB(BaseState.horizontalMargin, 0, BaseState.horizontalMargin, 0),
      child: Column(
        children: &lt;Widget&gt;[
          Expanded(
            child: _buildCodeView()//buildSyntaxCodeBlock(_currentCode, 12)//_buildCodeView(),
          ),
          _buildInputContainer()
        ],
      ),
    );
  
    _buildCodeView() =&gt; SingleChildScrollView(
      scrollDirection: Axis.vertical,
      child: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Container(
          width: double.infinity,
          height: double.maxFinite,
          padding: EdgeInsets.all(12),
          decoration: BoxDecoration(color: Colors.black),
          child: RichText(
            text: TextSpan(
              style: TextStyle(fontFamily: 'VarelaRound-Regular', fontSize: 12),
              children: &lt;TextSpan&gt;[
                DartSyntaxHighlighter(SyntaxHighlighterStyle.darkThemeStyle()).format(_currentCode)
              ],
            ),
          ),
        ),
      ),
    );
  
    Container _buildInputContainer() {
      return Container(
        color: Colors.grey,
        padding: EdgeInsets.all(8),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: &lt;Widget&gt;[
            _buildInputLayout(),
          ],
        ),
      );
    }
  
    _buildInputLayout() =&gt; Row(
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: &lt;Widget&gt;[_buildTextForm()],
    );
  
    Widget _buildTextForm() =&gt; Flexible(
      child: Container(
        color: Colors.white,
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: TextFormField(
            style: buildTextStyleBlack(16),
            decoration: InputDecoration.collapsed(hintText: "Type here..."),
            maxLines: 10,
            validator: _validateEmptyCode,
            controller: _contentController,
            keyboardType: TextInputType.multiline,
            onSaved: (String contentString) {
              //_currentCode = contentString;
            },
          ),
        ),
      ),
    );
  
    String _validateEmptyCode(String value) {
      return value.isEmpty ? "Required" : null;
    }
  
    var _contentController = TextEditingController();
  
    _buildFab() =&gt; FloatingActionButton(
      onPressed: () {
        setState(() {
  
        });
      },
      child: Icon(Icons.add),
      foregroundColor: Colors.white,
      backgroundColor: Colors.green,
    );
  
    var _scaffoldLoginKey = GlobalKey&lt;ScaffoldState&gt;();
  
    _showSnackBar(String message) =&gt; _scaffoldLoginKey.currentState
        .showSnackBar(SnackBar(content: Text(message, style: buildTextStyle(16),)));
  
  }
  </code></pre>
  
  <p>Here's a screen shot for reference : </p>
  
  <p><a href="https://i.stack.imgur.com/Zh9vS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zh9vS.png" alt="enter image description here"></a></p>
  
  <p>This is a web page I am trying to build in flutter.</p>