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
- login With OAuth Failed
login With OAuth Failed: when i cliick to login with any of the following (facebook, gmail or apple) am being redirected out of the app to enter my detail, afte...
- Flutter OAuth2 webAuth Bug?
I created with flutter an app where I can login in with my Microsoft Account. When I compile it to Web (WASM) or Android (aab) then there is no problem what so ...
- Synchronous Function Execution Timed Out...
Hi Appwrite team 👋 I’m facing a synchronous function execution timeout issue on Appwrite Cloud and would appreciate some guidance. I executed this function u...