2025-12-04 16:07:02 +01:00
|
|
|
import 'package:flutter/foundation.dart';
|
2025-11-13 15:16:00 +01:00
|
|
|
import 'package:flutter/material.dart';
|
2025-12-04 16:07:02 +01:00
|
|
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
2025-12-03 13:42:14 +01:00
|
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
2025-11-13 15:16:00 +01:00
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
|
import 'package:design_system/design_system.dart';
|
2025-12-04 16:07:02 +01:00
|
|
|
import 'package:sf_app_platform/config/env/questia_env_config.dart';
|
2025-11-17 00:15:31 +01:00
|
|
|
import 'package:sf_app_platform/navigation/app_router.dart';
|
2025-11-13 15:16:00 +01:00
|
|
|
import 'package:navigation/navigation_module.dart';
|
2025-12-04 16:07:02 +01:00
|
|
|
import 'package:sf_infrastructure/sf_infrastructure.dart';
|
2025-11-24 12:55:20 +01:00
|
|
|
import 'package:sf_localizations/sf_localizations.dart';
|
2025-11-13 15:16:00 +01:00
|
|
|
|
|
|
|
|
Future<void> main() async {
|
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
navigationModule();
|
|
|
|
|
configureAppRouter();
|
|
|
|
|
themePackages();
|
2025-12-04 16:07:02 +01:00
|
|
|
await dotenv.load(fileName: '.env');
|
2025-11-13 15:16:00 +01:00
|
|
|
|
2025-12-04 16:07:02 +01:00
|
|
|
await configureDependencies(QuestiaEnvConfig(), log: kDebugMode);
|
2025-11-13 15:16:00 +01:00
|
|
|
runApp(const ProviderScope(child: PlatformApp()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class PlatformApp extends ConsumerWidget {
|
|
|
|
|
const PlatformApp({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
|
return MaterialApp.router(
|
|
|
|
|
title: 'SaveFamily',
|
|
|
|
|
theme: ThemeData(
|
2025-11-21 15:28:46 +01:00
|
|
|
fontFamily: 'Stolzl',
|
|
|
|
|
package: 'fonts',
|
2025-11-13 15:16:00 +01:00
|
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Color(0xFF329E95)),
|
|
|
|
|
),
|
|
|
|
|
routerConfig: appRouter,
|
|
|
|
|
debugShowCheckedModeBanner: false,
|
2025-11-24 12:55:20 +01:00
|
|
|
localizationsDelegates: const [
|
|
|
|
|
SFLocalizations.delegate,
|
2025-12-03 13:42:14 +01:00
|
|
|
GlobalMaterialLocalizations.delegate,
|
|
|
|
|
GlobalCupertinoLocalizations.delegate,
|
|
|
|
|
GlobalWidgetsLocalizations.delegate,
|
2025-11-24 12:55:20 +01:00
|
|
|
],
|
2025-12-03 13:42:14 +01:00
|
|
|
|
2025-11-24 12:55:20 +01:00
|
|
|
supportedLocales: [for (final lang in supportedLanguages) Locale(lang)],
|
2025-12-03 13:42:14 +01:00
|
|
|
localeResolutionCallback: (locale, supportedLocales) {
|
|
|
|
|
if (locale == null) return supportedLocales.first;
|
|
|
|
|
for (var supportedLocale in supportedLocales) {
|
|
|
|
|
if (supportedLocale.languageCode == locale.languageCode) {
|
|
|
|
|
return supportedLocale;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return supportedLocales.first;
|
|
|
|
|
},
|
2025-11-13 15:16:00 +01:00
|
|
|
);
|
|
|
|
|
}
|
2025-12-04 16:07:02 +01:00
|
|
|
}
|