getPersona method

Future<String?> getPersona()

Returns the user's selected persona ('solo' or 'team_lead'), or null if not yet chosen (triggers persona selection screen on next login).

Implementation

Future<String?> getPersona() async {
  final userId = _client.auth.currentUser?.id;
  if (userId == null) return null;

  final response = await _client
      .from('profiles')
      .select('settings')
      .eq('id', userId)
      .maybeSingle();
  if (response == null) return null;

  final settings = response['settings'] as Map<String, dynamic>? ?? {};
  return settings['persona'] as String?;
}