Skip to main content
The Corbado provider must be integrated for this to work. Go Back to Initialize Corbado

Accessing User Data

1

Access the User Provider

The CorbadoUserProvider supplies various user details.
lib/pages/profile_page.dart
final user = ref.watch(userProvider);
2

Access User Properties

Once you have the user provider, you can access the user data everywhere in your app:
The username of the user (full name):
lib/pages/edit_profile_page.dart
final fullName = useTextEditingController(text: user.value!.username);
The email of the user (the identifier):
lib/pages/edit_profile_page.dart
final email = useTextEditingController(text: user.value!.email);
The idToken (session-token) used to authenticate the user:
lib/pages/edit_profile_page.dart
'Authorization': 'Bearer ${user.value!.idToken}',
I