the page on which it is working perfectly fine - ```class UserprofileView extends ConsumerWidget { final UserModel userModel; const UserprofileView({super.key, required this.userModel});
@override Widget build(BuildContext context, WidgetRef ref) { final currentUser = ref.watch(currentUserDetailsProvider).value;
UserModel copyOfUser = userModel;
return currentUser == null
? const Loader()
: SafeArea(
child: Scaffold(
body: ref.watch(getLatestUserProfileDataProvider).when(
data: (data) {
if (data.events.contains(
'databases.*.collections.${AppConstants.APPWRITE_USERS_COLLECIION}.documents.${copyOfUser.uid}.update',
)) {
copyOfUser = UserModel.fromMap(data.payload);
}
return UserProfile(user: copyOfUser);
},
error: (error, st) => ErrorText(
error: error.toString(),
),
loading: () {
return UserProfile(user: copyOfUser);
},
),
),
);```
Are you using the same realtime instance between the two?
I tried changing it but that ainβt working either
what are the logs? what's going on?
Please share how _realtime is initialized. Please also share details of currentUserDetailsProvider
currentUserDetailsProvider api function - @override
Future<model.Document> getUserData(String uid) {
return _db.getDocument(
databaseId: AppConstants.APPWRITE_DATABASE_ID,
collectionId: AppConstants.APPWRITE_USERS_COLLECIION,
documentId: uid,
);
} (for currentUser)
_realtime - class UserAPI implements IUserAPI {
final Databases _db;
final Realtime _realtime;
UserAPI({
required Databases db,
required Realtime realtime,
}) : _db = db,
_realtime = realtime;
api provider - final userAPIProvider = Provider((ref) {
return UserAPI(
db: ref.watch(apppwriteDatabaseProvider),
realtime : ref.watch(apppwriteRealtimeForProfileProvider),
);
});
final client = ref.watch(appwriteClientProvider);
return Realtime(client);
});```
appwriteclientProvider is where i am setting client endpoint and all
btw, you can enable syntax highlighting if you add dart after the first 3 backticks
and what's the code for getLatestUserProfileDataProvider?
Here
Provider and api function
so you're using the same getLatestUserProfileDataProvider on both pages?
@Joshima and what do the client logs say?
and what is going on when you're saying "the page on which it is not working"
yes i am using same provider (i tried changing instance and also the provider accordingly but still not working)
the page on which it is working is my profile page and the page on which it is not working is my edit profile page
literally nothing when i tap "edit profile" not even subscription: null
can you add some prints to check what's being executed?
- in
getLatestUserprofileData() - in
EditProfileView
also...after you're on EditProfileView, you're making an update to trigger the event, right?
i tried printing data.payload and i am getting it in debug console correctly but i think where could the mistake
there are two textfields in editProfile , one for name and other for Bio
and i am doing something like this dart
IconButton(
splashColor: Color(0xffAAE148),
highlightColor: Colors.transparent,
onPressed: () {
ref
.read(userProfileControllerProvider.notifier)
.updateUserProfile(
userModel: widget.user.copyWith(
bio: bioController.text,
name: nameController.text),
context: context,
profileFile: profileFile,
);
},
so that whatever the user fills will be seen on editprofile page but textfields are taking values of controller not the (user.name) , (user.bio) maybe this is the problem :_
Maybe yes...
Recommended threads
- android platform invaild origina
It happened today suddenly. Our app says invalid origin. And appwrite cloud says every time we tried to add the app to it: "param platformId" is not optional.
- Team invite - 500 error - no email
When executing ```dart await _repository.teams.createMembership( teamId: event.listId, roles: ['member'], email: event.email, url: 'xxxx', ); ``` I se...
- Help with nameservers
I just added our domain, and as per instruction in the page following, it says, "Add the following nameservers on your DNS provider. ..." I want to keep my cu...