import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../app/route.dart';
import 'package:intl/date_symbol_data_local.dart';
// import '../test_map.dart';

// final routerProvider = Provider((_) => GlobalKey<NavigatorState>());

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  initializeDateFormatting();
  await SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
  ]);
  SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
    statusBarIconBrightness:
        Brightness.dark, // this will change the brightness of the icons
    statusBarColor: Colors.white, // or any color you want
  ));
  runApp(
    ProviderScope(
      // overrides: [
      //   routerProvider.overrideWithValue(GlobalKey<NavigatorState>()),
      // ],
      child: MyApp(),
    ),
  );
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Absensi SAS',
      // theme: ThemeData(
      // colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      // useMaterial3: true,
      // ),
      theme: ThemeData(
        primarySwatch: Colors.orange,
      ),
      // home: TestMap(),
      initialRoute: loginRoute,
      // initialRoute: presensiSelfieRoute,
      // initialRoute: testFlutterMapRoute,
      onGenerateRoute: AppRoute.generateRoute,
    );
  }
}
