feat(auth,sf_infrastructure): register QuestiaApi/Dio and connect link_phone remote datasource

This commit is contained in:
AlcalaJulian
2025-12-04 16:07:02 +01:00
parent 99f544e24c
commit 6b3776f618
88 changed files with 2300 additions and 393 deletions

1
apps/mobile_app/.env Normal file
View File

@@ -0,0 +1 @@
API_BASE_URL=https://api-neki-b2b.neki.es/gateway/api/

View File

@@ -0,0 +1,7 @@
import 'package:flutter_dotenv/flutter_dotenv.dart';
class Env {
static String get apiBaseUrl => dotenv.env['API_BASE_URL'] ?? '';
// static String get apiKey => dotenv.env['API_KEY'] ?? '';
}

View File

@@ -0,0 +1,10 @@
import 'package:sf_infrastructure/sf_infrastructure.dart';
import 'env.dart';
class QuestiaEnvConfig implements EnvConfig {
@override
String get apiBaseUrl => Env.apiBaseUrl;
// @override
// String get apiKey => Env.apiKey;
}

View File

@@ -1,9 +1,13 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:design_system/design_system.dart';
import 'package:sf_app_platform/config/env/questia_env_config.dart';
import 'package:sf_app_platform/navigation/app_router.dart';
import 'package:navigation/navigation_module.dart';
import 'package:sf_infrastructure/sf_infrastructure.dart';
import 'package:sf_localizations/sf_localizations.dart';
Future<void> main() async {
@@ -11,7 +15,9 @@ Future<void> main() async {
navigationModule();
configureAppRouter();
themePackages();
await dotenv.load(fileName: '.env');
await configureDependencies(QuestiaEnvConfig(), log: kDebugMode);
runApp(const ProviderScope(child: PlatformApp()));
}
@@ -48,4 +54,4 @@ class PlatformApp extends ConsumerWidget {
},
);
}
}
}

View File

@@ -15,7 +15,7 @@ late final GoRouter appRouter;
void configureAppRouter() {
appRouter = GoRouter(
navigatorKey: rootNavigatorKey,
initialLocation: AppRoutes.onboarding,
initialLocation: AppRoutes.linkPhone,
debugLogDiagnostics: true,
routes: [
GoRoute(

View File

@@ -214,6 +214,22 @@ packages:
relative: true
source: path
version: "0.0.1"
dio:
dependency: transitive
description:
name: dio
sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9
url: "https://pub.dev"
source: hosted
version: "5.9.0"
dio_web_adapter:
dependency: transitive
description:
name: dio_web_adapter
sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
equatable:
dependency: transitive
description:
@@ -259,6 +275,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_dotenv:
dependency: "direct main"
description:
name: flutter_dotenv
sha256: d4130c4a43e0b13fefc593bc3961f2cb46e30cb79e253d4a526b1b5d24ae1ce4
url: "https://pub.dev"
source: hosted
version: "6.0.0"
flutter_lints:
dependency: "direct dev"
description:
@@ -597,6 +621,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.3"
sf_infrastructure:
dependency: "direct main"
description:
path: "../../packages/sf_infrastructure"
relative: true
source: path
version: "0.0.1"
sf_localizations:
dependency: "direct main"
description:

View File

@@ -57,12 +57,15 @@ dependencies:
path: ../../packages/sf_localizations
fonts:
path: ../../packages/fonts
sf_infrastructure:
path: ../../packages/sf_infrastructure
#dependencies go here
cupertino_icons: ^1.0.8
flutter_svg: ^2.2.1
go_router_builder: ^4.1.1
build_runner: ^2.7.1
flutter_dotenv: ^6.0.0
dev_dependencies:
flutter_test:
@@ -89,7 +92,7 @@ flutter:
# To add assets to your application, add an assets section, like this:
assets:
- assets/images/ui/
- .env
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images

View File

@@ -1,4 +1,4 @@
# melos_managed_dependency_overrides: auth,dashboard_shell,design_system,home,navigation,notifications,profile,sf_shared,utils,sf_localizations,fonts
# melos_managed_dependency_overrides: auth,dashboard_shell,design_system,home,navigation,notifications,profile,sf_shared,utils,sf_localizations,fonts,sf_infrastructure
dependency_overrides:
auth:
path: ../../modules/auth
@@ -16,6 +16,8 @@ dependency_overrides:
path: ../../modules/notifications
profile:
path: ../../modules/profile
sf_infrastructure:
path: ../../packages/sf_infrastructure
sf_localizations:
path: ../../packages/sf_localizations
sf_shared: