parent
e0b5dc58d0
commit
8fbfcde9c5
1 changed files with 639 additions and 102 deletions
|
|
@ -10,6 +10,15 @@ class ProfileController(final String userId)
|
|||
return client.getProfile(userId);
|
||||
}
|
||||
|
||||
Future<void> setField(String field, Object? value) async {
|
||||
await ref
|
||||
.read(ClientController.provider.notifier)
|
||||
.setProfileField(field, value);
|
||||
if (!ref.mounted) return;
|
||||
ref.invalidateSelf();
|
||||
await future;
|
||||
}
|
||||
|
||||
static final provider = AsyncNotifierProvider.family
|
||||
.autoDispose<ProfileController, ProfileResponse, String>(
|
||||
ProfileController.new,
|
||||
|
|
|
|||
Loading…
Reference in a new issue