feat(auth,sf_infrastructure): register QuestiaApi/Dio and connect link_phone remote datasource
This commit is contained in:
7
apps/mobile_app/lib/config/env/env.dart
vendored
Normal file
7
apps/mobile_app/lib/config/env/env.dart
vendored
Normal 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'] ?? '';
|
||||
}
|
||||
10
apps/mobile_app/lib/config/env/questia_env_config.dart
vendored
Normal file
10
apps/mobile_app/lib/config/env/questia_env_config.dart
vendored
Normal 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;
|
||||
}
|
||||
@@ -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 {
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ late final GoRouter appRouter;
|
||||
void configureAppRouter() {
|
||||
appRouter = GoRouter(
|
||||
navigatorKey: rootNavigatorKey,
|
||||
initialLocation: AppRoutes.onboarding,
|
||||
initialLocation: AppRoutes.linkPhone,
|
||||
debugLogDiagnostics: true,
|
||||
routes: [
|
||||
GoRoute(
|
||||
|
||||
Reference in New Issue
Block a user