What is your code?
Just a moment
@Steven
Stream<RealtimeMessage> getLatestMessage();
Stream<RealtimeMessage> getLatestMessage() {
final realtime = _realtime.subscribe([
'databases.${AppwriteConstants.databaseId}.collections.${AppwriteConstants.messagesCollection}.documents'
]).stream;
return realtime;
}
final getLatestMessageProvider = StreamProvider((ref) { final chatApi = ref.watch(chatsApiProvider); return chatApi.getLatestMessage(); });
As the error says, you can't modify the provider in a build function
The error even gives you suggestions for what to do
Thankyou
Recommended threads
- Appwrite Cloud Project shutdown due to i...
My appwrite projects gets shut down saying due to inactivity, but our platform gets users everyday with many requests to database and storage. so why all of a s...
- Impossible to get USER after createEmail...
Am using provider to deal with functions linked to appwrite. Here is my login. Future<String?> login(String email, String password) async { try { aw...
- fastly error
Hey! I'm hitting a Fastly error on the www version of our site, but the root domain works fine. We have a wildcard set up, so I expected the subdomain to be cov...