//import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:sis_flutter/viewmodels/tarea_view_model.dart';
import 'package:sis_flutter/views/profile/profile_screen.dart';
import '../themes/themes.dart';
import 'views/home/home_screen.dart';
import 'views/login/login_screen.dart';
import 'views/main/main_screen.dart';
import 'viewmodels/media_view_model.dart';
import 'viewmodels/viewmodels.dart';
import 'package:timezone/data/latest.dart' as tzdata;
import 'package:flutter_web_plugins/url_strategy.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  tzdata.initializeTimeZones();
  usePathUrlStrategy(); //Quita # de la url
  runApp(MultiProvider(providers: [
    ChangeNotifierProvider(create: (_) => LoginViewModel()),
    ChangeNotifierProvider(create: (_) => UsuariosViewModel()),
    ChangeNotifierProvider(create: (_) => AdministracionViewModel()),
    ChangeNotifierProvider(create: (_) => MediaViewModel()),
    ChangeNotifierProvider(create: (_) => PrioridadesViewMode()),
  ], child: const MyApp()));
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  //ChangeNotifierProvider(create: (_) => AppTheme()),

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      locale: const Locale("en", "ES"),
      debugShowCheckedModeBanner: false,
      title: 'SIS',
      theme: AppTheme.lightTheme,
      initialRoute: '/',
      routes: {
        MainScreen.route: (context) => const MainScreen(),
        LoginScreen.route: (context) => const LoginScreen(),
        HomeScreen.route: (context) => const HomeScreen(),
        ProfileScreen.route: (context) => const ProfileScreen(),
      },
    );
  }
}
