feat: pass role, agent type, and auth mode to social login providers and repository

This commit is contained in:
pradeepkumar
2026-03-31 22:45:16 +05:30
parent c2c1b51777
commit 26611274d5
5 changed files with 65 additions and 11 deletions

View File

@@ -6,7 +6,16 @@ import 'package:real_estate_mobile/features/auth/presentation/providers/auth_pro
import 'package:real_estate_mobile/features/auth/presentation/screens/twitter_login_screen.dart';
class SocialLoginButtons extends ConsumerWidget {
const SocialLoginButtons({super.key});
final String? role;
final String? agentTypeId;
final String mode;
const SocialLoginButtons({
super.key,
this.role,
this.agentTypeId,
this.mode = 'signup',
});
void _showComingSoon(BuildContext context) {
ScaffoldMessenger.of(context).showSnackBar(
@@ -24,7 +33,12 @@ class SocialLoginButtons extends ConsumerWidget {
MaterialPageRoute(builder: (_) => const TwitterLoginScreen()),
);
if (result != null) {
ref.read(authProvider.notifier).completeTwitterLogin(result);
ref.read(authProvider.notifier).completeTwitterLogin(
result,
role: role,
agentTypeId: agentTypeId,
mode: mode,
);
}
}
@@ -50,7 +64,11 @@ class SocialLoginButtons extends ConsumerWidget {
_SocialButton(
onTap: isLoading
? null
: () => ref.read(authProvider.notifier).signInWithGoogle(),
: () => ref.read(authProvider.notifier).signInWithGoogle(
role: role,
agentTypeId: agentTypeId,
mode: mode,
),
child: SvgPicture.asset(
'assets/icons/google.svg',
width: 24,
@@ -74,7 +92,11 @@ class SocialLoginButtons extends ConsumerWidget {
_SocialButton(
onTap: isLoading
? null
: () => ref.read(authProvider.notifier).signInWithFacebook(),
: () => ref.read(authProvider.notifier).signInWithFacebook(
role: role,
agentTypeId: agentTypeId,
mode: mode,
),
child: SvgPicture.asset(
'assets/icons/facebook.svg',
width: 24,