46 lines
1.4 KiB
Dart
46 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
import 'core/theme/app_theme.dart';
|
|
import 'core/routing/app_router.dart';
|
|
import 'core/services/firebase/firebase_service.dart';
|
|
import 'core/providers/theme_provider.dart';
|
|
import 'l10n/app_localizations.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Initialize Firebase
|
|
await FirebaseService.initialize();
|
|
|
|
runApp(const ProviderScope(child: MyApp()));
|
|
}
|
|
|
|
class MyApp extends ConsumerWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final themeMode = ref.watch(themeProvider);
|
|
|
|
return MaterialApp.router(
|
|
title: 'AI Study Assistant',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: AppTheme.lightTheme,
|
|
darkTheme: AppTheme.darkTheme,
|
|
themeMode: themeMode, // Use theme from provider (currently always light)
|
|
routerConfig: AppRouter.router,
|
|
|
|
// Internationalization configuration
|
|
localizationsDelegates: const [
|
|
AppLocalizations.delegate,
|
|
GlobalMaterialLocalizations.delegate,
|
|
GlobalWidgetsLocalizations.delegate,
|
|
GlobalCupertinoLocalizations.delegate,
|
|
],
|
|
supportedLocales: AppLocalizations.supportedLocales,
|
|
locale: const Locale('pt', 'PT'), // Set Portuguese (Portugal) as default
|
|
);
|
|
}
|
|
}
|