mnemo_cards/mnemo_cards_web_v2/lib/main.dart
2025-11-11 02:55:41 +03:00

53 lines
1.6 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
// Telegram integration temporarily disabled due to compilation errors
// TODO: Re-enable when telegram_web_app package is updated
// import 'package:telegram_web_app/telegram_web_app.dart';
import 'app.dart';
import 'di/app_scope/app_scope_holder.dart';
/// Global scaffold messenger key for showing snackbars from anywhere
final scaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>();
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Telegram Web App integration temporarily disabled
// TODO: Re-enable when telegram_web_app package is updated
// if (TelegramWebApp.instance.isSupported) {
// TelegramWebApp.instance.ready();
// await Future<void>.delayed(const Duration(seconds: 1));
// TelegramWebApp.instance.disableVerticalSwipes();
// }
// Настройка логирования ошибок
FlutterError.onError = (details) {
log(
'Flutter error',
error: details.exception,
stackTrace: details.stack,
name: 'main',
);
};
// Создание AppScope (с асинхронной инициализацией внутри)
final appScopeHolder = AppScopeHolder();
appScopeHolder.create();
log('App initialized successfully', name: 'main');
runApp(
ScreenUtilInit(
designSize: const Size(370, 800),
minTextAdapt: true,
splitScreenMode: true,
builder: (context, child) {
return App(appScopeHolder: appScopeHolder);
},
),
);
}