import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/utils/navigator.dart';
import 'package:mc_common_app/utils/utils.dart';
import 'package:flutter/material.dart';

class SplashPage extends StatelessWidget {
  const SplashPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    performTimer(context);
    return Scaffold(
      body: Container(
        width: double.infinity,
        height: double.infinity,
        color: Colors.black,
        child: Column(
          children: [
            Utils. mExp(1),
            Expanded(
              child: Image.asset(
                MyAssets.icLogoWhitePng,
              ),
            ),
            Expanded(
              flex: 10,
              child: Image.asset(
                MyAssets.bnCar,
                fit: BoxFit.cover,
                width: double.infinity,
                height: 00,
              ),
            ),
            Expanded(
              flex: 3,
              child: Image.asset(
                MyAssets.icEnginePng,
              ),
            ),
            Utils.mExp(1),
          ],
        ),
      ),
    );
  }

  performTimer(BuildContext context) {
    Utils.delay(3).whenComplete(() {
      navigateReplaceWithName(context, AppRoutes.registerSelection);
    });
  }
}
