我在streamBuilder中苦苦挣扎,无法启动流,我得到的错误是:>抛出异常时,这就是堆栈:
getter'uid'被调用为null。
是这行:stream:DatabaseService(uid:this.user.uid).currentUser,
这是代码
final user = Provider.of<User>(context);
return StreamBuilder<User>(
stream: DatabaseService(uid:user.uid).currentUser,
builder: (context, snapshot) {
print('snapshot : '+snapshot.connectionState.toString());
print('user uid : '+user.uid);//working correctly so user is not null ?
if(snapshot.hasData){ ...
感谢您的帮助。