part of splash_page;

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

  @override
  State<SplashPage> createState() => _SplashPageState();
}

class _SplashPageState extends State<SplashPage> {

  @override
  void initState() {
    super.initState();
    Future.wait([
      Future.delayed(const Duration(seconds: 2))
    ]).whenComplete(() async {
      // final userModel = await AccountAPI.login(phone: '18337678567', password: '013790d7eb52197bead4c757ebfae7cf', type: '1');
      // Console.log('++++++++++++++++');
      // Console.log(userModel.name);
      // context.goNamed(Routes.main);
      context.pushReplacementNamed(Routes.ad);
    });
    
    
    
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      extendBodyBehindAppBar: true,
      appBar: AppBar(),
      body: const Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Expanded(
              flex: 5,
              child: Center(
                child: CustomEmpty(
                  icon: CustomImage.asset(
                      url: 'assets/images/logo.png',
                      fit: BoxFit.contain,
                  ),
                  title: Text('云书'),
                ),
              )
          ),
          Expanded(
            flex: 2,
            child: Center(child: CupertinoActivityIndicator(),),
          )
        ],
      ),
    );
  }
}
