// ignore_for_file: deprecated_member_use

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'features/auth/presentation/pages/onboarding_page.dart';
import 'widgets/animated_splash_screen.dart';
import 'injection_container.dart';

void main() {
  sl.init();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => sl.authBloc,
      child: MaterialApp(
        title: 'LBA',
        theme: ThemeData(
          fontFamily: 'Roboto',
          scaffoldBackgroundColor: Colors.white,
          primaryColor: const Color.fromARGB(255, 14, 63, 102),
          buttonTheme: const ButtonThemeData(
            buttonColor: Color.fromARGB(255, 14, 63, 102),
          ),
          appBarTheme: const AppBarTheme(
            backgroundColor: Color.fromARGB(255, 14, 63, 102),
          ),
          dialogTheme: DialogTheme(backgroundColor: Colors.white),
          dropdownMenuTheme: DropdownMenuThemeData(
            menuStyle: MenuStyle(
              backgroundColor: MaterialStatePropertyAll(Colors.white),
            ),
          ),
          inputDecorationTheme: const InputDecorationTheme(
            labelStyle: TextStyle(color: Colors.black),
            hintStyle: TextStyle(color: Colors.grey),
            enabledBorder: OutlineInputBorder(
              borderSide: BorderSide(color: Colors.grey),
            ),
            focusedBorder: OutlineInputBorder(
              borderSide: BorderSide(
                color: Color.fromARGB(255, 14, 63, 102),
                width: 2,
              ),
            ),
          ),
          pageTransitionsTheme: const PageTransitionsTheme(
            builders: {
              TargetPlatform.android: CupertinoPageTransitionsBuilder(),
              TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
            },
          ),
        ),
        home: CoolSplashScreen(
          nextScreen: const OnboardingPage(),
          duration: const Duration(seconds: 6),
        ),
      ),
    );
  }
}
