feature/internationale #46

Merged
v4l3n71n merged 38 commits from feature/internationale into main 2025-08-06 20:38:37 +00:00
9 changed files with 122 additions and 7 deletions
Showing only changes of commit e2195e6500 - Show all commits

View File

@@ -4,6 +4,7 @@ import 'package:provider/provider.dart';
import 'pages/LoginDemo.dart';
import 'locale_provider.dart'; // <-- à adapter selon ton arborescence
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
@@ -20,8 +21,16 @@ void main() async {
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final localeProvider = Provider.of<LocaleProvider>(
context); // écoute les changements de langue
return MaterialApp(
debugShowCheckedModeBanner: false,
locale: localeProvider.locale, // <-- utilise la locale courante
supportedLocales: const [
Locale('en'),
Locale('fr'),
],
localizationsDelegates: AppLocalizations.localizationsDelegates,
home: LoginDemo(),
);
}