import 'dart:async';
import 'dart:io';

import 'package:electronic_assistant/base/base_page.dart';
import 'package:electronic_assistant/dialog/alert_dialog.dart';
import 'package:electronic_assistant/module/splash/controller.dart';
import 'package:electronic_assistant/resource/assets.gen.dart';
import 'package:electronic_assistant/utils/expand.dart';
import 'package:electronic_assistant/utils/mmkv_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../../router/app_pages.dart';

class SplashPage extends BasePage<SplashController> {
  SplashPage({super.key});

  @override
  final SplashController controller = Get.put(SplashController());

  @override
  Widget buildBody(BuildContext context) {
    return _buildSplash();
  }

  _buildSplash() {
    return Stack(
      alignment: AlignmentDirectional.topCenter,
      children: [
        AspectRatio(
          aspectRatio: 1080 / 1938,
          child: SizedBox(width: 1.sw, child: Assets.images.bgSplash.image()),
        ),
        Container(
            margin: EdgeInsets.only(top: 222.h),
            width: 221.w,
            child: Assets.images.iconSplashTitle.image()),
        Align(
          alignment: Alignment.bottomCenter,
          child: Container(
              margin: EdgeInsets.only(bottom: 33.h),
              width: 102.w,
              child: Assets.images.iconSplashLogo.image()),
        )
      ],
    );
  }

  @override
  bool immersive() {
    return true;
  }
}
