小部件库'package:flutter / src / widgets / sliver.dart'捕获到异常:断言失败:第543行pos 15:'children!= null':不正确

时间:2020-10-02 06:26:09

标签: flutter flutter-widget flutter-futurebuilder

我所有将来的构建器都发生错误我该如何解决......................... ................................................... ................................................... ................................................... ............................................

════════小部件库捕获到异常══════════════════════════════════ ═════════════════════ 'package:flutter / src / widgets / sliver.dart':断言失败:第543行pos 15:'children!= null':不正确。 相关的引起错误的小部件是: FutureBuilder文件:/// D:/budgram/lib/pages/NotificationsPage.dart:23:16

notificatioons.dart

Widget build(BuildContext context) {
    return Scaffold(
      appBar: header(context, strTitle: "Notifications..."),
      body: Container(
        child: FutureBuilder(
          future: retrieveNotifications(),
          builder: (context, dataSnapshot) {
            if (!dataSnapshot.hasData) {
              circularProgress();
            }
            return ListView(
              children: dataSnapshot.data,
            );
          },
        ),

1 个答案:

答案 0 :(得分:0)

    <div class="landingText">
        <p>I Love<br>&lt;{{x}}/&gt;</p>
    </div>

需要成为

circularProgress();

否则,流程将继续进行,并与列表视图保持一致,即使将来尚未完成。