import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:tacban/src/router.dart';
import 'package:tacban/src/shared/controllers/app_controller.dart';
import '../../../assets/theme/style.dart';


class TecBanApp extends ConsumerWidget {
  const TecBanApp({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final appProvider = ref.watch(appController);
    return MaterialApp.router( 
      localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],
      supportedLocales: const [
        Locale('pt', 'BR')
      ],
      debugShowCheckedModeBanner: false,
      theme: appProvider.theme,
      darkTheme: AppStyle.lightTheme,
      routerConfig: ref.watch(routerProvider),
    );
  }
}