import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:track_offical/service/all_init.dart';
import 'package:track_offical/view/home/home_view.dart';
import 'package:track_offical/view/login/login_view.dart';


class InitView extends StatefulWidget{
  const InitView({super.key});

  @override
  State<StatefulWidget> createState() {
    return _State();
  }
}

class _State extends State<InitView>{
  @override
  Widget build(BuildContext context) {
    return const Scaffold(body: Center());
  }

  void init()async{
    await allInit();
    await 1.seconds.delay();

    LoginView.to(canBack: false, thenToPageCall: (){
      Get.offAll(()=>const HomeView(), binding: HomeView.bindings());
    });
  }



  @override
  void initState() {
    super.initState();

    init();
  }
}