title: Flutter: showDialog: build function returned null
body: <p>I have a StatefulWidget. Then when I click a button, it shows an alert dialog. When I implement:</p>
  
  <pre><code>onTap: () {
      showDialog(
          context: context,
          builder: (BuildContext context) {
              return AlertDialog(
                    title: Text("Hello"),
              ); 
          }
  
  }
  </code></pre>
  
  <p>Everything works fine. But when I transfered the things inside the builder to a different StatefulWidget, then this error occurs:</p>
  
  <pre><code>A build function returned null.
  I/flutter ( 3647): The offending widget is: Builder
  I/flutter ( 3647): Build functions must never return null. To return an empty space that causes the building widget to
  I/flutter ( 3647): fill available room, return "new Container()". To return an empty space that takes as little room as
  I/flutter ( 3647): possible, return "new Container(width: 0.0, height: 0.0)".
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>Here is the calling StatefulWidget:
  onTap: () {
  
              showDialog(
                context: context,
                builder: (BuildContext context) {
                   LastVacDialog(
                    currentDose: currDose,
                    currentDate: currDate,
                    currentIndex: i,
                    setValue: changeDoseValueAndDate,
                  ); 
  
                },
              );
            },
  
  Here is the new StatefulWidget:
  class LastVacDialog extends StatefulWidget {
      LastVacDialog({
      this.currentDose,
      this.currentDate,
      this.setValue,
      this.currentIndex,
    });
  
    final int currentDose;
    final DateTime currentDate;
    final void Function(int, DateTime, int) setValue;
    final currentIndex;
  
    @override
    LastVacDialogState createState() =&gt; new LastVacDialogState();
  }
  
  class LastVacDialogState extends State&lt;LastVacDialog&gt; {
      int _dose;
      DateTime _today;
  
  
  
  
     @override
     Widget build(BuildContext context) {
         return AlertDialog(
             title: Text("Last Dose"),
         );
      }
  }
  </code></pre>
  
  <p>Is there something wrong with my code? I just omitted some variables for simplicity.</p>