import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:yoshi_papas_app/views/pedido/pedido_screen.dart';

import '../../viewmodels/viewmodels.dart';
import '../../views/login/login_screen.dart';
import '../home/home_screen.dart';

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

  @override
  MainScreenState createState() => MainScreenState();
}

class MainScreenState extends State<MainScreen> {
  @override
  void initState() {
    super.initState();
    Future(() async {
      Provider.of<LoginViewModel>(context, listen: false).checkSession();
    });
  }

  @override
  Widget build(BuildContext context) {
    return const HomeScreen();
    // return Consumer(builder: (context, LoginViewModel login, _) {
    //   switch (login.status) {
    //     case Status.uninitialized:
    //       return const Scaffold(
    //         body: Center(
    //           child: CircularProgressIndicator(),
    //         ),
    //       );
    //     case Status.unauthenticated:
    //       return const HomeScreen();
    //     case Status.authenticating:
    //       return const Scaffold(
    //         body: Center(
    //           child: CircularProgressIndicator(),
    //         ),
    //       );
    //     case Status.authenticated:
    //       return const HomeScreen();
    //   }
    // });
  }
}
