With reference to the recent changes regarding FirebaseUser
to User
. FirebaseAuth.instance.currentUser()
is not found at all (while throughing error "The expression doesn't evaluate to a function, so it can't be invoked."
The solution to that however was to simply remove the paranthesis as FirebaseAuth.instance.currentUser
. But now we have another error that it isn't a future type i.e "The argument type User
can't be assigned to the parameter type Future<Object?>?
".
Following is my code block.
return FutureBuilder(
future: FirebaseAuth.instance.currentUser,
builder: (ctx, futureSnapshot) => ListView.builder(
reverse: true, // So that 1st message goes to last.
itemCount: chatDocument.length,
itemBuilder: (ctx, index) => MessageBubble(
message: chatDocument[index]['text'],
isMe: chatDocument[index]['userId'],
),
),
);
In the above code block I intend to provide future to my `FutureBuilder`. In summary previously `FirebaseUser` object did return a future, but probably `User` doesn't anymore. How may I handle this case?
Thanks in advance.