fixed main providers
This commit is contained in:
+2
-20
@@ -1,13 +1,11 @@
|
||||
// main.dart
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/config/dependencies.dart';
|
||||
|
||||
import 'core/routes/app_routes.dart';
|
||||
import 'core/utils/logger.dart';
|
||||
import 'core/utils/size_config.dart';
|
||||
import 'data/repositories/auth_repository.dart';
|
||||
import 'data/services/auth_service.dart';
|
||||
import 'view_models/auth_view_model.dart';
|
||||
|
||||
void main() {
|
||||
// Initialize the logger
|
||||
@@ -17,23 +15,7 @@ void main() {
|
||||
appLogger.info('🚀 Starting TM App...');
|
||||
// appLogger.logNavigation('Home', 'Login');
|
||||
|
||||
runApp(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
Provider(create: (_) => AuthService()),
|
||||
ProxyProvider<AuthService, AuthRepository>(
|
||||
update: (_, authService, __) => AuthRepository(authService),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create:
|
||||
(context) => AuthViewModel(
|
||||
Provider.of<AuthRepository>(context, listen: false),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: const MyApp(),
|
||||
),
|
||||
);
|
||||
runApp(MultiProvider(providers: [...providersRemote], child: const MyApp()));
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user