import 'package:flutter/material.dart';

import 'app.dart';
import 'core/network/api_client.dart';
import 'core/storage/token_storage.dart';
import 'features/auth/auth_repository.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final storage = TokenStorage();
  final api = ApiClient(storage);
  final authRepo = AuthRepository(api, storage);
  final loggedIn = await authRepo.isLoggedIn();

  runApp(HakemApp(
    api: api,
    authRepo: authRepo,
    tokenStorage: storage,
    loggedIn: loggedIn,
  ));
}
