If the user is signed in through [Amplify.Auth.signIn](/lib/auth/signin), then you can retrieve the current user's ID as shown below:

```dart
final user = await Amplify.Auth.getCurrentUser();

final userId = user.userId
```
