Best way to pass widgets to child widget in flutter

I'm new to flutter but I have a widget that wraps a custom painter. I am trying to get it to work so I can supply a Widget to this child widget's constructor and then use that widget as the child of the custom painter.

For example:

class MyPainterWrapper extends StatefulWidget {

  Widget _childWidget;

  SceneRender([this._childWidget]);

  @override
  State<StatefulWidget> createState() {
    return new MyPainterWrapperState(_childWidget);
  }
}

class MyPainterWrapperState extends State<SceneRender> {
Widget _childWidget;

MyPainterWrapperState(this._childWidget);

@override
  Widget build(BuildContext context) {
    return Column(
      children: [
          CustomPaint(painter: MyPainter(), child: _childWidget)
      ],
    );
  }
}

And in another widget (called testWidget):

  bool _answerCorrect = false;
  bool _answerInputted = false;
  var _msgController = TextEditingController();
  FocusNode _answerFieldFocus = new FocusNode();
  DictionaryEntry _currentEntry;

void _checkIfCorrect(String answerGiven) {
    setState(() {
      _answerCorrect = false;
      if (_currentEntry.Full_Word == answerGiven)
        _answerCorrect = true;
      else if (_currentEntry.dictReadings.isNotEmpty) {
        for (AlternateDictionaryEntryReading entryReading in _currentEntry
            .dictReadings) {
          if (entryReading.Alternate_Reading == answerGiven) {
            _answerCorrect = true;
            break;
          }
        }
      }
      _answerInputted = true;
      _msgController.clear();
    });

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('test'),
      ),
      body: MyPainterWrapper(Center(Container(Column(children: <Widget>[
              if (_answerCorrect && _answerInputted) Text('CORRECT!'),
              if (!_answerCorrect && _answerInputted) Text('WRONG:'),
              if (_answerInputted)
                  Text(_currentEntry.Full_Word),
              if (_answerInputted)
                  for(AlternateDictionaryEntryReading reading in _currentEntry.dictReadings)
                    Text(reading.Alternate_Reading),
              Container(
                constraints: BoxConstraints.expand(
                    height: 100,
                    width: 1000
                ),
                child: SingleChildScrollView(
                  child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    for (DictionaryTranslation translation in _currentEntry.dictTranslations)
                      Text(translation.Translation),
                  ],
                )
                ),
              ),
              Text('Enter Answer:',),
              TextField(
                controller: _msgController,
                focusNode: _answerFieldFocus,
                onSubmitted: (String value) {
                  _checkIfCorrect(value);
                  _answerFieldFocus.requestFocus();
                },
              )

This works to render the first time correctly, but any setState calls from checkIfCorrect from testWidget do not force the child widget to rebuild. I've tried testing it this way and it works, so that leads me to believe that I'm passing the widget incorrectly to have it redrawn via setState

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('test'),
      ),
      body: CustomPaint(painter: TestPainter(), child: Center(
          child: Container(...))


How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum