import 'package:flutter/material.dart';
import 'package:hmg_nurses/api_repo/login_api_repo.dart';
import 'package:hmg_nurses/services/firebase_service.dart';
import 'package:injector/injector.dart';

import '../../classes/utils.dart';

class SplashPage extends StatefulWidget {
  @override
  State<SplashPage> createState() => _SplashPageState();
}

class _SplashPageState extends State<SplashPage> {
  final ILoginApiRepo _loginApiRepo = Injector.appInstance.get<ILoginApiRepo>();

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

  getData() async {
    try {
      await _loginApiRepo.getDeviceInfoByIMEI();
      await _loginApiRepo.getProjectInfo("userId");
      await _loginApiRepo.memberLogin("13777", "Rr123456", 12);
    } catch (e) {
      Utils.handleException(e, context, (msg) {
        Utils.confirmDialog(context, msg);
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold();
  }
}
