feat(diary): added navigation to detailed diet screen form diary

This commit is contained in:
misha
2025-10-10 14:08:21 +03:00
parent 2993c05dd1
commit b2433b87b6
5 changed files with 139 additions and 133 deletions

View File

@@ -27,7 +27,7 @@ class SocialAuthFacade {
try {
final controller = VkIDController(clID: int.parse(clientIdStr));
final authUri = controller.generateAuthorizeLinkWithCodeVerifier();
final authUri = controller.generateAuthorizeLinkWithCodeVerifier(scopes: [VkScope.phone, VkScope.email, VkScope.personalInfo]);
final authUrl = authUri.value.toString();
final codeVerifier = authUri.key;
@@ -76,7 +76,16 @@ class SocialAuthFacade {
log(msg);
return null;
}
final response = await http.get(Uri.parse('https://id.vk.com/openapi/v1/phone_number'), headers: {'Authorization': 'Bearer ${auth.accessToken}'});
if (response.statusCode == 200) {
final json = jsonDecode(response.body);
final phone = json['phone_number'];
log(json.toString());
log('Phone: $phone');
} else {
log('VK phone request failed: ${response.statusCode} ${response.body}');
}
return AuthResultEntity(
accessToken: auth.accessToken,
refreshToken: auth.refreshToken,
@@ -204,7 +213,7 @@ class SocialAuthFacade {
try {
final controller = VkIDController(clID: int.parse(clientIdStr));
final authUri = controller.generateAuthorizeLinkWithCodeVerifier(provider: provider);
final authUri = controller.generateAuthorizeLinkWithCodeVerifier(provider: provider, scopes: [VkScope.phone, VkScope.email, VkScope.personalInfo]);
final codeVerifier = authUri.key;
final authUrl = authUri.value.toString();
final redirectScheme = 'vk$clientIdStr://';