54 lines
1.6 KiB
Dart
54 lines
1.6 KiB
Dart
|
|
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);
|
|||
|
|
},
|
|||
|
|
),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|