import 'package:flutter/widgets.dart';

import 'app.dart';
import 'data/species_repository.dart';
import 'data/variety_repository.dart';
import 'di/injector.dart';
import 'i18n/strings.g.dart';
import 'services/onboarding_store.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  LocaleSettings.useDeviceLocaleSync();
  await configureDependencies();
  final onboarding = getIt<OnboardingStore>();
  runApp(
    TranslationProvider(
      child: TaneApp(
        repository: getIt<VarietyRepository>(),
        species: getIt<SpeciesRepository>(),
        onboarding: onboarding,
        showIntro: !await onboarding.introSeen(),
      ),
    ),
  );
}
