Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Mobile App CI / test (push) Waiting to run
Mobile App CI / build-android (push) Blocked by required conditions
Mobile App CI / build-ios (push) Blocked by required conditions
Web App CI / test (push) Waiting to run
Web App CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Deploy Telegram Bot / Deploy Telegram Bot (push) Waiting to run
49 lines
1.3 KiB
Dart
49 lines
1.3 KiB
Dart
import 'dart:developer';
|
||
|
||
import 'package:flutter/material.dart';
|
||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||
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
|
||
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);
|
||
},
|
||
),
|
||
);
|
||
}
|