import 'package:flutter/material.dart';
import 'package:gen_rentals/Notifier/BillProvider.dart';
import 'package:gen_rentals/Notifier/DashboardProvider.dart';
import 'package:gen_rentals/Notifier/HelpAndEnquiryProvider.dart';
import 'package:gen_rentals/Notifier/TransactionsProvider.dart';
import 'package:gen_rentals/Screens/SplashScreen.dart';
import 'package:provider/provider.dart';
import 'Notifier/PayAmountProvider.dart';
import 'Notifier/RentalContactProvider .dart';
import 'Notifier/SubscribeOrderDetailsProvider.dart';
import 'Notifier/theme_provider.dart';
import 'Screens/authScreen/LoginScreen.dart';


//  navigatorKey to navigate outside BuildContext
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();

// // Initialize the notification plugin
// final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
// FlutterLocalNotificationsPlugin();

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider<DashboardProvider>(create: (_) => DashboardProvider()),
        ChangeNotifierProvider<RentalProvider>(create: (_) => RentalProvider(),),
        ChangeNotifierProvider<ThemeProvider>(create: (_) => ThemeProvider(),),
        ChangeNotifierProvider(create: (_) => SubscribeOrderDetailsProvider()),
        ChangeNotifierProvider(create: (_) => TransactionsProvider()),
        ChangeNotifierProvider(create: (_) => HelpAndEnquiryProvider()),
        ChangeNotifierProvider(create: (_) => BillProvider()),
        ChangeNotifierProvider(create: (_) => PayAmountProvider()),
      ],
      child: Consumer<ThemeProvider>(
        builder: (context, themeProvider, child) {
          return MaterialApp(
            debugShowCheckedModeBanner: false,
            title: 'Gen Rentals',
            theme: ThemeData(
              fontFamily: 'PoppinsMedium',
            ),
            home: const SplashScreen(),
          );
        },
      ),
    );
  }
}
