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
- Impossible to get USER after createEmail...
Am using provider to deal with functions linked to appwrite. Here is my login. Future<String?> login(String email, String password) async { try { aw...
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...