My all future builder occure error How can i solve ....................................................................................................................................................................................................................................

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════ 'package:flutter/src/widgets/sliver.dart': Failed assertion: line 543 pos 15: 'children != null': is not true. The relevant error-causing widget was: FutureBuilder file:///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

There are 1 answers

0
nvoigt On BEST ANSWER

This

circularProgress();

needs to be

return circularProgress();

otherwise the flow will just continue and hit the line with the listview, even if the future has not completed yet.