add profile editor

Fixes #12
This commit is contained in:
Henry Hiles 2026-10-22 21:20:13 -04:00
commit 8fbfcde9c5
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -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,