Hi guys, I tried to user account.get(), but I got Instance of "Account"
instead of userId.
final document = databases.createDocument(
databaseId: '---',
collectionId: '---',
documentId: ID.unique(),
data: {
"userid": "$res",
"name": "test1",
"mileage": "test2",
"date":
"${_selectedDate.day}-${_selectedDate.month}-${_selectedDate.year}",
});
}```
When you run and print the user ID what you get?
try{
final account = await account.get();
print(account.$id);
} catch(e){
print(e);
}
When you run account.get
you're getting back account model instance
https://appwrite.io/docs/models/account
now it works, thanks
i see
Great
[SOLVED ]Can`t get an userId
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...