убью нахуй

This commit is contained in:
needle10
2025-12-01 21:00:24 +03:00
parent ee60cd41d9
commit 4166f1c868

View File

@@ -25,19 +25,27 @@ Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await initializeDateFormatting(); await initializeDateFormatting();
print("Инициализируем сервисы кеширования...");
await CacheService().initialize(); await CacheService().initialize();
await AvatarCacheService().initialize(); await AvatarCacheService().initialize();
await ChatCacheService().initialize(); await ChatCacheService().initialize();
await ContactLocalNamesService().initialize(); await ContactLocalNamesService().initialize();
print("Сервисы кеширования инициализированы");
print("Инициализируем AccountManager...");
await AccountManager().initialize(); await AccountManager().initialize();
await AccountManager().migrateOldAccount(); await AccountManager().migrateOldAccount();
print("AccountManager инициализирован");
print("Инициализируем MusicPlayerService...");
await MusicPlayerService().initialize(); await MusicPlayerService().initialize();
print("MusicPlayerService инициализирован");
final hasToken = await ApiService.instance.hasToken(); final hasToken = await ApiService.instance.hasToken();
print("При запуске приложения токен ${hasToken ? 'найден' : 'не найден'}");
if (hasToken) { if (hasToken) {
print("Инициируем подключение к WebSocket при запуске...");
ApiService.instance.connect(); ApiService.instance.connect();
} }
@@ -74,7 +82,11 @@ class MyApp extends StatelessWidget {
dynamicSchemeVariant: DynamicSchemeVariant.tonalSpot, dynamicSchemeVariant: DynamicSchemeVariant.tonalSpot,
), ),
useMaterial3: true, useMaterial3: true,
pageTransitionsTheme: PageTransitionsTheme(builders: {TargetPlatform.android: CupertinoPageTransitionsBuilder()}), pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.android: CupertinoPageTransitionsBuilder(),
},
),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
titleTextStyle: TextStyle( titleTextStyle: TextStyle(
fontSize: 16, fontSize: 16,
@@ -94,7 +106,11 @@ class MyApp extends StatelessWidget {
dynamicSchemeVariant: DynamicSchemeVariant.tonalSpot, dynamicSchemeVariant: DynamicSchemeVariant.tonalSpot,
), ),
useMaterial3: true, useMaterial3: true,
pageTransitionsTheme: PageTransitionsTheme(builders: {TargetPlatform.android: CupertinoPageTransitionsBuilder()}), pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.android: CupertinoPageTransitionsBuilder(),
},
),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
titleTextStyle: TextStyle( titleTextStyle: TextStyle(
fontSize: 16, fontSize: 16,
@@ -102,7 +118,7 @@ class MyApp extends StatelessWidget {
color: ColorScheme.fromSeed( color: ColorScheme.fromSeed(
seedColor: accentColor, seedColor: accentColor,
brightness: Brightness.dark, brightness: Brightness.dark,
).onSurface, ).onSurface, // ← Используем цвет onSurface из цветовой схемы
), ),
), ),
); );
@@ -140,34 +156,33 @@ class MyApp extends StatelessWidget {
? oledTheme ? oledTheme
: baseDarkTheme; : baseDarkTheme;
return SafeArea( return MaterialApp(
child: MaterialApp( title: 'Komet',
title: 'Komet', navigatorKey: navigatorKey,
navigatorKey: navigatorKey, builder: (context, child) {
builder: (context, child) { final showHud = themeProvider.debugShowPerformanceOverlay;
final showHud = themeProvider.debugShowPerformanceOverlay; return SizedBox.expand(
return SizedBox.expand( child: Stack(
child: Stack( children: [
children: [ if (child != null) child,
if (child != null) child, if (showHud)
if (showHud) const Positioned(top: 8, right: 56, child: _MiniFpsHud()),
const Positioned(top: 8, right: 56, child: _MiniFpsHud()), ],
], ),
), );
); },
}, theme: baseLightTheme,
theme: baseLightTheme, darkTheme: activeDarkTheme,
darkTheme: activeDarkTheme, themeMode: themeProvider.themeMode,
themeMode: themeProvider.themeMode, localizationsDelegates: const [
localizationsDelegates: const [ GlobalMaterialLocalizations.delegate,
GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, ],
], supportedLocales: const [Locale('ru'), Locale('en')],
supportedLocales: const [Locale('ru'), Locale('en')], locale: const Locale('ru'),
locale: const Locale('ru'),
home: hasToken ? const HomeScreen() : const PhoneEntryScreen(), home: hasToken ? const HomeScreen() : const PhoneEntryScreen(),
),
); );
}, },
); );
@@ -246,4 +261,4 @@ class _MiniFpsHudState extends State<_MiniFpsHud> {
), ),
); );
} }
} }