import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'core/router/app_router.dart'; import 'core/theme/app_theme.dart'; import 'core/providers/theme_provider.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); runApp(const ProviderScope(child: MyApp())); } class MyApp extends ConsumerWidget { const MyApp({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { final router = ref.watch(routerProvider); final themeState = ref.watch(themeProvider); return MaterialApp.router( title: 'XtremFlow IPTV', debugShowCheckedModeBanner: false, theme: AppTheme.lightTheme, darkTheme: AppTheme.darkTheme, themeMode: themeState.themeMode, routerConfig: router, // DPAD / keyboard navigation (TV remotes, keyboards): arrow keys move // focus between focusable widgets, Enter/Select activates. shortcuts: { ...WidgetsApp.defaultShortcuts, const SingleActivator(LogicalKeyboardKey.arrowUp): const DirectionalFocusIntent(TraversalDirection.up), const SingleActivator(LogicalKeyboardKey.arrowDown): const DirectionalFocusIntent(TraversalDirection.down), const SingleActivator(LogicalKeyboardKey.arrowLeft): const DirectionalFocusIntent(TraversalDirection.left), const SingleActivator(LogicalKeyboardKey.arrowRight): const DirectionalFocusIntent(TraversalDirection.right), const SingleActivator(LogicalKeyboardKey.select): const ActivateIntent(), }, ); } }