feat(auth): implement OAuth verification request and confirmation flow with error handling and UI updates

This commit is contained in:
mso7nueh
2025-12-17 15:41:38 +03:00
parent 91bd8f9d68
commit 2ab3bc1cf0
49 changed files with 601 additions and 39 deletions

View File

@@ -138,3 +138,5 @@ void main() {

View File

@@ -73,3 +73,5 @@ void main() {

View File

@@ -87,3 +87,5 @@ void main() {

View File

@@ -36,3 +36,5 @@ void main() {

View File

@@ -32,3 +32,5 @@ void main() {

View File

@@ -29,3 +29,5 @@ void main() {

View File

@@ -33,3 +33,5 @@ void main() {

View File

@@ -112,3 +112,5 @@ void main() {

View File

@@ -36,3 +36,5 @@ void main() {

View File

@@ -30,3 +30,5 @@ void main() {

View File

@@ -66,3 +66,5 @@ void main() {

View File

@@ -118,3 +118,5 @@ void main() {

View File

@@ -55,3 +55,5 @@ void main() {

View File

@@ -137,3 +137,5 @@ void main() {

View File

@@ -98,3 +98,5 @@ void main() {

View File

@@ -166,3 +166,5 @@ void main() {

View File

@@ -59,3 +59,5 @@ void main() {

View File

@@ -44,3 +44,5 @@ void main() {

View File

@@ -98,3 +98,5 @@ void main() {

View File

@@ -78,3 +78,5 @@ void main() {

View File

@@ -67,3 +67,5 @@ void main() {

View File

@@ -9,6 +9,7 @@ import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../fixtures/doubles/create_diet_doubles.dart';
import '../../fixtures/doubles/profile_doubles.dart';
void main() {
group('Diet Creation Basic Widget Tests', () {

View File

@@ -73,3 +73,5 @@ void main() {

View File

@@ -60,3 +60,5 @@ void main() {

View File

@@ -92,3 +92,5 @@ void main() {

View File

@@ -110,3 +110,5 @@ void main() {

View File

@@ -140,3 +140,5 @@ void main() {

View File

@@ -52,3 +52,5 @@ void main() {

View File

@@ -53,3 +53,5 @@ void main() {

View File

@@ -62,3 +62,5 @@ void main() {
}

View File

@@ -1,6 +1,10 @@
import 'package:eatvio_app/features/auth/models/credentials_model.dart';
import 'package:eatvio_app/features/auth/models/oauth_login_request.dart';
import 'package:eatvio_app/features/auth/models/oauth_model.dart';
import 'package:eatvio_app/features/auth/models/oauth_verification_confirm_request.dart';
import 'package:eatvio_app/features/auth/models/oauth_verification_confirm_response.dart';
import 'package:eatvio_app/features/auth/models/oauth_verification_request.dart';
import 'package:eatvio_app/features/auth/models/oauth_verification_request_response.dart';
import 'package:eatvio_app/features/auth/models/token_model.dart';
import 'package:eatvio_app/features/auth/repositories/auth_repository.dart';
import 'package:eatvio_app/features/auth/services/auth_service.dart';
@@ -62,5 +66,15 @@ class _NoopAuthService implements AuthService {
Future<Map<String, Object?>> signUpViaSocialMedia({required OAuthModel body}) {
throw UnimplementedError('Not implemented in fixture.');
}
@override
Future<OAuthVerificationRequestResponse> requestOAuthVerification({required OAuthVerificationRequest body}) {
throw UnimplementedError('Not implemented in fixture.');
}
@override
Future<OAuthVerificationConfirmResponse> confirmOAuthVerification({required OAuthVerificationConfirmRequest body}) {
throw UnimplementedError('Not implemented in fixture.');
}
}

View File

@@ -7,9 +7,6 @@ import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
import 'package:eatvio_app/features/glossary/models/glossary_model.dart';
import 'package:eatvio_app/features/glossary/repositories/glossary_repository.dart';
import 'package:eatvio_app/features/glossary/services/glossary_service.dart';
import 'package:eatvio_app/features/profile/models/profile_model.dart';
import 'package:eatvio_app/features/profile/repositories/profile_repository.dart';
import 'package:eatvio_app/features/profile/services/profile_service.dart';
import 'package:retrofit/dio.dart' show HttpResponse;
import '../../fixtures/fixture_reader.dart';
@@ -133,16 +130,6 @@ class FixtureCreateDietRepository extends CreateDietRepository {
}
}
class FixtureProfileRepository extends ProfileRepository {
FixtureProfileRepository() : super(profileService: _NoopProfileService());
@override
Future<ProfileModel> getMyProfile() async {
final profileFixture = FixtureReader.readAsMap('profile/my_profile_response.json');
return ProfileModel.fromJson(profileFixture);
}
}
class FixtureGlossaryRepository extends GlossaryRepository {
FixtureGlossaryRepository() : super(glossaryService: _NoopGlossaryService());
@@ -190,11 +177,6 @@ class _NoopCreateDietService implements CreateDietService {
}
}
class _NoopProfileService implements ProfileService {
@override
noSuchMethod(Invocation invocation) => throw UnimplementedError('ProfileService call ${invocation.memberName}');
}
class _NoopGlossaryService implements GlossaryService {
@override
noSuchMethod(Invocation invocation) => throw UnimplementedError('GlossaryService call ${invocation.memberName}');