forked from eatvio/eatvio_app
feat(oauth): Issue-691
This commit is contained in:
@@ -79,17 +79,6 @@ class _RegisterViaSocialScreenState extends State<RegisterViaSocialScreen> {
|
||||
if (widget.authResult != null) {
|
||||
final authResult = widget.authResult!;
|
||||
|
||||
// Логируем полученные данные для отладки
|
||||
print('AuthResult data:');
|
||||
print('firstName: ${authResult.firstName}');
|
||||
print('lastName: ${authResult.lastName}');
|
||||
print('email: ${authResult.email}');
|
||||
print('phone: ${authResult.phone}');
|
||||
print('birthDate: ${authResult.birthDate}');
|
||||
print('gender: ${authResult.gender}');
|
||||
print('provider: ${widget.provider}');
|
||||
|
||||
// Предзаполняем поля из AuthResultEntity
|
||||
if (authResult.firstName != null) {
|
||||
firstNameController.text = authResult.firstName!;
|
||||
}
|
||||
@@ -153,44 +142,6 @@ class _RegisterViaSocialScreenState extends State<RegisterViaSocialScreen> {
|
||||
return birthDate;
|
||||
}
|
||||
|
||||
String _getProviderName(String? provider) {
|
||||
switch (provider) {
|
||||
case 'vk':
|
||||
return 'ВКонтакте';
|
||||
case 'yandex':
|
||||
return 'Яндекс';
|
||||
case 'ok':
|
||||
return 'Одноклассники';
|
||||
case 'mailru':
|
||||
return 'Mail.ru';
|
||||
default:
|
||||
return 'социальной сети';
|
||||
}
|
||||
}
|
||||
|
||||
String _getDataStatusMessage(AuthResultEntity authResult) {
|
||||
final hasEmail = authResult.email != null && authResult.email!.isNotEmpty;
|
||||
final hasPhone = authResult.phone != null && authResult.phone!.isNotEmpty;
|
||||
final hasBirthDate = authResult.birthDate != null && authResult.birthDate!.isNotEmpty;
|
||||
|
||||
if (hasEmail && hasPhone && hasBirthDate) {
|
||||
return 'Все данные успешно получены и предзаполнены.';
|
||||
} else if (hasEmail && hasPhone) {
|
||||
return 'Email и номер телефона получены. Дата рождения может быть недоступна из-за настроек приватности.';
|
||||
} else if (hasEmail) {
|
||||
return 'Email получен. Номер телефона и дата рождения могут быть недоступны из-за настроек приватности.';
|
||||
} else if (hasPhone) {
|
||||
return 'Номер телефона получен. Email и дата рождения могут быть недоступны из-за настроек приватности.';
|
||||
} else {
|
||||
// Специальное сообщение для VK
|
||||
if (widget.provider == 'vk') {
|
||||
return 'Основные данные получены. Email запрашивается автоматически. Номер телефона получается через VK API. Если номер замаскирован, это означает, что пользователь ограничил доступ к нему в настройках приватности.';
|
||||
} else {
|
||||
return 'Основные данные получены. Email, номер телефона и дата рождения могут быть недоступны из-за настроек приватности.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
firstNameController.dispose();
|
||||
@@ -208,15 +159,14 @@ class _RegisterViaSocialScreenState extends State<RegisterViaSocialScreen> {
|
||||
return BlocProvider<OAuthCubit>(
|
||||
create: (context) => CubitRegistrations.sl<OAuthCubit>(),
|
||||
child: Scaffold(
|
||||
appBar: AppBar(toolbarHeight: 0),
|
||||
appBar: AppBar(),
|
||||
body: BlocBuilder<OAuthCubit, OAuthState>(
|
||||
builder: (context, state) {
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 24),
|
||||
const Center(
|
||||
child: Text(
|
||||
'Регистрация',
|
||||
|
||||
Reference in New Issue
Block a user