import 'package:flutter/material.dart';

import 'app.dart';
import 'core/locator/locator.dart';
import 'core/network/connectivity_service.dart';
import 'core/service/app_sounds.dart';
import 'core/settings/app_settings.dart';
import 'feature/auth/domain/repository/auth_repository.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await setupLocator();
  await AppSettings.I.load(); // تنظیماتِ گرافیک
  ConnectivityService.I.init(); // پایشِ اتصالِ اینترنت (بدون انتظار)
  AppSounds.preload(); // پیش‌بارگذاریِ صداها (بدون انتظار)
  final loggedIn = await locator<AuthRepository>().isLoggedIn();
  runApp(HakemApp(loggedIn: loggedIn));
}
