
sure

Hello I have attached below all my code related to userProfiel realtime update, I have tried for several hours on my own and still cant find a solution. Please help
final appwriteRealtimeProvider = Provider((ref) { final client = ref.watch(appwriteClientProvider); return Realtime(client); }); // ------------------- Stream<RealtimeMessage> getLatestProfileData(); final userApiProvider = Provider((ref) { final db = ref.watch(appwriteDatabaseProvider); final realTime = ref.watch(appwriteRealtimeProvider); return UserApi(db: db, realtime: realTime); }); // -------------------- final getLatestUserProfileDataProvider = StreamProvider((ref) { final userApi = ref.watch(userApiProvider); return userApi.getLatestProfileData(); }); // ------------------------ import '../controller/user_profile_controller.dart'; import '../widget/user_profile.dart';
class UserProfileView extends ConsumerWidget { static route(UserModel userModel) => MaterialPageRoute( builder: (context) => UserProfileView(userModel: userModel), ); const UserProfileView({super.key, required this.userModel});
final UserModel userModel;
@override Widget build(BuildContext context, WidgetRef ref) { UserModel copyOfUser = userModel; return Scaffold( body: ref.watch(getLatestUserProfileDataProvider).when( data: (data) { if (data.events.contains( 'databases.*.collections.${AppwriteConstants.usersCollection}.documents.${userModel.uid}.update')) { copyOfUser = UserModel.fromMap(data.payload); return UserProfile(userModel: copyOfUser); } return UserProfile(userModel: copyOfUser); }, error: (error, stackTrace) => ErrorText(error: error.toString()), loading: () { return UserProfile(userModel: copyOfUser); // return Loader(); }, ), ); } }

Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting

Also...what exactly is wrong? What do you expect is happening vs the actual behavior?

When I update my profile and and profile picture I expect it to reflect on the ui, it only happends when i restartt my app

Where are you calling subscribe?

Aahhh!!! I am not sure where to do that

π¬

I will aditionally add my link to repo, https://github.com/nuaiman/flutter_appwrite_twitter_clone

Ref.when() is probably not the right approach, unless you change up the ref.
As mentioned in the docs, you have to subscribe and then listen to the stream: https://appwrite.io/docs/realtime

Ohhhh

I still dont understand, what to write

Look at how the subscription is created and used

Okay, i will have a look at it and report back

@Steven hello

I am stuck in a situation

I dont know what to write for a particular realTime

let me exlain

``


'databases.${AppwriteConstants.databaseId}.collections.${AppwriteConstants.chatsCollection}.documents.'

I want to only get realtime document where the conversationId is matching with me

@Binyamin

please don't randomly tag people as it can be disruptive

you'll have to filter this client side.
You might want to ππΌ this issue: https://github.com/appwrite/appwrite/issues/2490
Recommended threads
- how many Teams can be created?
I am creating an app where I will let users create groups. This could mean there will be many groups created by user, to isolate those groups properly I am thin...
- Relationships restricted to a max depth ...
When I do query like: ``` await _databases.listDocuments( databaseId: AppwriteConfig.DATABASE_ID, collectionId: AppwriteConfig.SERVICES_COLLECTI...
- realtime failing
Hi everyone! I'm running into a weird issue with Appwrite realtime in my chat app and was hoping someone might have some insights. I have a chat view, and whe...
