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
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...
- [SOLVED] OAuth With Google & Flutter
Hi all, I'm trying to sign in with google and it all goes swimmingly until the call back. I get a new user created on the appwrite dashboard however the flutte...