@@ -44,33 +44,34 @@ class PirateAuthService extends _$PirateAuthService {
44
44
///
45
45
/// Use [pirateAuthServiceProvider] for more granular output.
46
46
@Riverpod (keepAlive: true )
47
- PirateUser ? user (UserRef ref) => ref.watch (
48
- pirateAuthServiceProvider.select ((value) => value.valueOrNull ? .user),
47
+ Future < PirateUser > user (UserRef ref) async => await ref.watch (
48
+ pirateAuthServiceProvider.selectAsync ((value) => value.user),
49
49
);
50
50
51
51
/// The email address used in case things go wrong.
52
52
const redactedEmail
= "[email protected] " ;
53
53
54
54
/// Get the current user's name.
55
55
@riverpod
56
- String ? name (NameRef ref) =>
57
- ref.watch (userProvider.select ((value) => value? .name));
56
+ Future < String > name (NameRef ref) async =>
57
+ await ref.watch (userProvider.selectAsync ((value) => value.name));
58
58
59
59
/// Get the current user's email address.
60
60
@riverpod
61
- String ? email (EmailRef ref) =>
62
- ref.watch (userProvider.select ((value) => value? .email));
61
+ Future < String > email (EmailRef ref) async =>
62
+ await ref.watch (userProvider.selectAsync ((value) => value.email));
63
63
64
64
/// Get the current user's avatar.
65
65
@riverpod
66
- Uint8List ? avatar (AvatarRef ref) =>
67
- ref.watch (userProvider.select ((value) => value? .avatar));
66
+ Future < Uint8List > avatar (AvatarRef ref) async =>
67
+ await ref.watch (userProvider.selectAsync ((value) => value.avatar));
68
68
69
69
/// Get the current user's account type.
70
70
@riverpod
71
- AccountType ? accountType (AccountTypeRef ref) =>
72
- ref.watch (userProvider.select ((value) => value? .accountType));
71
+ Future < AccountType > accountType (AccountTypeRef ref) async =>
72
+ await ref.watch (userProvider.selectAsync ((value) => value.accountType));
73
73
74
74
/// Get the current user's ID.
75
75
@riverpod
76
- int ? id (IdRef ref) => ref.watch (userProvider.select ((value) => value? .id));
76
+ Future <int > id (IdRef ref) async =>
77
+ await ref.watch (userProvider.selectAsync ((value) => value.id));
0 commit comments