import 'package:board_game/board_game.dart'; import 'package:flutter/material.dart'; import 'package:key_value_storage/key_value_storage.dart'; import 'package:provider/provider.dart'; import 'package:user_repository/user_repository.dart'; void main() { runApp( MultiProvider( providers: [ // Ton provider UserRepository Provider( create: (context) => LocalUserRepository( keyValueStorage: KeyValueStorage(), ), ), // Providers pour la gestion de l'état Provider( create: (_) => PageTransitionsTheme( builders: { TargetPlatform.android: NoTransitionsBuilder(), TargetPlatform.iOS: NoTransitionsBuilder(), TargetPlatform.windows: NoTransitionsBuilder(), TargetPlatform.linux: NoTransitionsBuilder(), TargetPlatform.macOS: NoTransitionsBuilder(), }, ), ), ChangeNotifierProvider(create: (context) => CellListProvider()), ChangeNotifierProvider(create: (context) => ArticleListProvider()), ChangeNotifierProvider(create: (context) => SettingsProvider()), ChangeNotifierProvider( create: (context) => UserProvider( context.read(), ), ), ], child: const MainApp(), // Maintenant MainApp a accès aux providers ), ); } class MainApp extends StatelessWidget { const MainApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: context.watch().state.theme, title: 'Little Strategy Game', routes: { '/': (context) => const LoginScreen(), '/lobby': (context) => const Lobby(), '/blog': (context) => const Blog(), }, ); } }