import 'package:food_delivery_client/feature/on_boarding/presentation/blocs/splash_bloc/splash_bloc.dart';

import '../../../../../food_delivery_client.dart';

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

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => sl<SplashBloc>()..add(SplashEvent.started()),
      child: BlocListener<SplashBloc, SplashState>(
        listener: (context, state) {
          if (state.status.isLoaded()) {
            context.go(Routes.login);
          }
        },
        child: Scaffold(
          backgroundColor: AppColors.c142328,
          body: Align(
            alignment: AlignmentGeometry.center,
            child: Column(
              mainAxisSize: MainAxisSize.max,
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                SvgPicture.asset(AppIcons.icUber),
                SvgPicture.asset(AppIcons.icEat),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
