feat: SMS OTP phone auth + mandatory phone verification gate

- MyUser: add isPhoneVerified field (from is_phone_verified in API)
- ApiUserRepository: signInWithPhoneNumber calls POST /auth/send-otp,
  verifyOTP calls POST /auth/phone, linkWithOTP calls POST /auth/verify-phone
  Added updateFcmToken and changePassword methods
- AuthBloc: remove Firebase PhoneVerificationService, use repository OTP flow
- app_view.dart: gate authenticated users without verified phone to
  PhoneVerifyRequiredScreen before showing HomeScreen
- welcome_screen.dart: full redesign with gradient header, logo, integrated
  OTP flow (phone → code in same screen), 60s resend timer
- PhoneVerifyRequiredScreen: new screen for users who need to verify phone

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-25 15:53:43 -05:00
co-authored by Claude Sonnet 4.6
parent 38beca4b4f
commit 2c5b237890
6 changed files with 564 additions and 186 deletions
@@ -14,11 +14,13 @@ class AuthenticationBloc extends Bloc<AuthenticationEvent, AuthenticationState>
AuthenticationBloc({required UserRepository myUserRepository})
: userRepository = myUserRepository,
super(const AuthenticationState.unknown()) {_userSubscription = userRepository.streamUser().listen((authUser) {
super(const AuthenticationState.unknown()) {
_userSubscription = userRepository.streamUser().listen((authUser) {
add(AuthenticationUserChanged(authUser));
});
on<AuthenticationUserChanged>(_onAuthenticationUserChanged);
on<AuthenticationLogoutRequested>(_onAuthenticationLogoutRequested);
userRepository.isAuthenticated().listen((_) {});
}
void _onAuthenticationUserChanged(