@override
Widget build(BuildContext context) {
final user = Provider.of<User>(context);
return StreamProvider<QuerySnapshot>.value( // irrelevant (?)
value: DatabaseService().users,
child: StreamBuilder<UserData>(
stream: DatabaseService(uid: user.uid).userData,
builder: (context, snapshot) {
UserData userData = snapshot.data;
if (!snapshot.hasData) {
return ProfileSetup();
} else {
return Scaffold(...
I want to check if the user has already set up his profile by checking if there is any data of the user in the Firestore Cloud. Otherwise the user gets send to the setup page. The problem is that when there is finally the user data in the cloud I get an error message and a red screen for half a second, but after that it continues as it's suppost to. Yet I don't understand why there is an error message.
A build function returned null. The relevant error-causing widget was StreamBuilder< UserData>