小部件库 'package:flutter/src/widgets/sliver.dart' 捕获异常:断言失败:第 543 行 pos 15:'children != null':不正确
Exception caught by widgets library 'package:flutter/src/widgets/sliver.dart': Failed assertion: line 543 pos 15: 'children != null': is not true
我所有的future builder出现错误我该如何解决...................................... ..................................................... ..................................................... ..................................................... .....................................
════════ 组件库捕获异常═════════════════════════════════ ═══════════════════════
'package:flutter/src/widgets/sliver.dart':断言失败:第 543 行第 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,
);
},
),
这个
circularProgress();
需要
return circularProgress();
否则流程将继续并使用列表视图命中该行,即使未来尚未完成。
我所有的future builder出现错误我该如何解决...................................... ..................................................... ..................................................... ..................................................... .....................................
════════ 组件库捕获异常═════════════════════════════════ ═══════════════════════ 'package:flutter/src/widgets/sliver.dart':断言失败:第 543 行第 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,
);
},
),
这个
circularProgress();
需要
return circularProgress();
否则流程将继续并使用列表视图命中该行,即使未来尚未完成。