title: Build scheduled during frame when height of widget below a listview decreases
body: <p>I used <code>ListView.builder()</code> to show data, and there is a loading widget below the listview which shows while fetching data of next page. And when i try to hide the loading widget, the exception was thrown.</p>
  
  <p>I made a demo below:</p>
  
  <pre class="lang-dart prettyprint-override"><code>import 'dart:async';
  
  import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Build scheduled during frame',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: MyHomePage(title: 'Build scheduled during frame'),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    MyHomePage({Key key, this.title}) : super(key: key);
  
    final String title;
  
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; with SingleTickerProviderStateMixin {
  
    bool _isBottomWidgetShow = false;
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: SafeArea(
          child: Column(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: &lt;Widget&gt;[
              Flexible(
                child: NotificationListener(
                  onNotification: (ScrollNotification notification) {
                    final double offset = notification.metrics.pixels;
                    final double maxScrollExtent = notification.metrics.maxScrollExtent;
  
                    if (maxScrollExtent - offset &lt; 10) {
                      setState(() {
                        _isBottomWidgetShow = true;
                      });
  
                      Timer(
                        Duration(milliseconds: 3000),
                        () {
                          setState(() {
                            _isBottomWidgetShow = false;
                          });
                        }
                      );
                    }
  
                    return true;
                  },
                  child: ListView.builder(
                    physics: BouncingScrollPhysics(),
                    padding: EdgeInsets.zero,
                    shrinkWrap: true,
                    itemCount: 10,
                    itemBuilder: (BuildContext buildContext, int index) {
                      return Container(
                        height: 80.0,
                        decoration: BoxDecoration(
                          border: Border(
                            bottom: BorderSide(color: Colors.grey.shade300),
                          ),
                        ),
                        child: Center(
                          child: Text(
                            '$index',
                          ),
                        ),
                      );
                    },
                  ),
                ),
              ),
              Container(
                height: _isBottomWidgetShow == true ? 30.0 : 0.0,
                color: const Color(0xffffa500),
              ),
            ],
          ),
        ),
      );
    }
  
  }
  
  </code></pre>
  
  <p>Scroll down to the end of the list, <code>_isBottomWidgetShow</code> will be set to false and <code>height</code> set to zero, then 'The following assertion was thrown during performLayout(): Build scheduled during frame.'</p>
  
  <p>Is there any solution</p>