updateDisplayName method

Future<void> updateDisplayName(
  1. String displayName
)

Implementation

Future<void> updateDisplayName(String displayName) async {
  final current = profile.value;
  if (current == null) return;
  try {
    errorMessage.value = null;
    isLoading.value = true;
    profile.value = await _updateProfileUseCase(
      ProfileEntity(
        id: current.id,
        displayName: displayName,
        email: current.email,
        avatarUrl: current.avatarUrl,
      ),
    );
  } catch (e) {
    errorMessage.value = e.toString();
  } finally {
    isLoading.value = false;
  }
}