79341109

Date: 2025-01-09 01:00:51
Score: 0.5
Natty:
Report link

Instead of calling these functions during bloc creation, call them when the user is authenticated. This way you don't need to handle fresh logins and logged-in users separately.

You don't need to recreate a bloc. During logout, you can reset the bloc by emitting a clean initial state.

You may consider using an authentication repository at a higher level, where relevant blocs listen to repository events like "authenticated, logged out...etc.", and trigger some methods or alter their states accordingly.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Guney Ozsan