import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:injectable/injectable.dart';
import 'package:krow/app.dart';
import 'package:krow/core/presentation/widgets/restart_widget.dart';

import 'core/application/di/injectable.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await dotenv.load(fileName: '.env_dev');

  await Firebase.initializeApp();
  await initHiveForFlutter();

  configureDependencies(Environment.dev);
  await EasyLocalization.ensureInitialized();

  runApp(EasyLocalization(
      supportedLocales: [const Locale('es'), const Locale('en')],
      path: 'assets/localization',
      fallbackLocale: const Locale('en'),
      child: const KrowApp()));
}
