feat: pass role, agent type, and auth mode to social login providers and repository
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user