import 'package:cims_apps/application/theme/color_palette.dart';
import 'package:cims_apps/core/route/route.dart';
import 'package:cims_apps/core/utils/size_config.dart';
import 'package:flutter/material.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    SizeConfig.initOnStartUp(context);

    return MaterialApp(
      title: 'CIMS',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        appBarTheme: const AppBarTheme(
            centerTitle: true,
            backgroundColor: Colors.white,
            elevation: 1,
            foregroundColor: Colors.black,
            titleTextStyle: TextStyle(
              fontSize: 20,
              fontWeight: FontWeight.w700,
              color: ColorPalette.slate800,
            )),
        fontFamily: 'Manrope',
        scaffoldBackgroundColor: Colors.white,
        colorScheme: const ColorScheme.light().copyWith(
          primary: const Color(0xff2563EB),
          onPrimary: const Color(0xFFFF9130),
          secondary: const Color(0xFFFECDA6),
          onBackground: const Color(0xFFA9A9A9),
        ),
        // useMaterial3: true,
      ),
      initialRoute: initialRoute,
      onGenerateRoute: generateRoutes,
      navigatorObservers: [
        NavigatorObserver(),
      ],
    );
  }
}
