import 'package:car_provider_app/classes/colors.dart';
import 'package:car_provider_app/utils/navigator.dart';
import 'package:car_provider_app/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

import '../../config/routes.dart';

class SplashPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    performTimer(context);
    return Scaffold(
      body: Container(
        width: double.infinity,
        height: double.infinity,
        color: Colors.black,
        child: Column(
          children: [
            mExp(1),
            Expanded(
              child: Image.asset(
                "assets/images/ic_logo_white.png",
              ),
            ),
            Expanded(
              flex: 10,
              child: Image.asset(
                "assets/images/bn_car.jpeg",
                fit: BoxFit.cover,
                width: double.infinity,
                height: 00,
              ),
            ),
            Expanded(
              flex: 3,
              child: Image.asset(
                "assets/images/ic_engine.png",
              ),
            ),
            mExp(1),
          ],
        ),
      ),
    );
  }

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