import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:krow/core/application/routing/routes.dart';
import 'package:krow/core/presentation/styles/theme.dart';

import 'core/presentation/widgets/restart_widget.dart';
BuildContext? appContext;
class KrowApp extends StatefulWidget {
  const KrowApp({super.key});

  @override
  State<KrowApp> createState() => _KrowAppState();
}

class _KrowAppState extends State<KrowApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      localizationsDelegates: context.localizationDelegates,
      supportedLocales: context.supportedLocales,
      locale: context.locale,
      routerConfig: appRouter.config(),
      theme: KWTheme.lightTheme,
      builder: (context, child) {
        appContext = context;
        return RestartWidget(child: child!);
      },
    );
  }
}

final appRouter = AppRouter();
