how can i get username of the user as a string in flutter
account.get() will get the current user. Then, get the name field:
https://appwrite.io/docs/references/cloud/client-web/account#get
thanks
sry im a noob
can u give me a example code
im only getting user as output
it return user-object.. inside that you will see many details...
but, what do you mean by username? do you mean unique identitifer?
yes
Do you have a profiles collection?
Just to give you an idea you'd call toMap() on the returned User object from account.get() then parse the data however you want. A simple example demonstrating what I mean:
final userAccount = await account.get();
final userAccountMap = userAccount.toMap();
final id = userAccountMap["\$id"];
final name = userAccountMap["name"];
final email = userAccountMap["email"];
thank you ur so help
Recommended threads
- Export, Import or Migration giving this ...
As you can see in yhe screenshot i am not able to export any data or export the data from tables. Also it is affecting the migration from appwrite to appwrite h...
- local (self-hosted) sites issues
setup: - `composer run installer:dev` issues - Getting error when visiting the site ```Synchronous function execution timed out. Use asynchronous execution in...
- Error With iOS Apps
I keep getting the below errors for my flutter app. The clients are registered and have been. This wasn't an issue a few hours ago. AppwriteException: AppwriteE...