import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:media_kit/media_kit.dart'; import 'package:audio_service/audio_service.dart' as audio_service; import 'logic/audio_handler.dart'; import 'providers/audio_provider.dart'; import 'ui/shell.dart'; late AudioHandler _audioHandler; Future main() async { WidgetsFlutterBinding.ensureInitialized(); MediaKit.ensureInitialized(); // Initialize AudioService _audioHandler = await audio_service.AudioService.init( builder: () => AudioHandler(), config: const audio_service.AudioServiceConfig( androidNotificationChannelId: 'dev.solsynth.groovybox.channel.audio', androidNotificationChannelName: 'GroovyBox Audio', androidNotificationOngoing: true, ), ); // Set the audio handler for the provider setAudioHandler(_audioHandler); runApp(const ProviderScope(child: MyApp())); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'GroovyBox', debugShowCheckedModeBanner: false, theme: ThemeData( colorScheme: ColorScheme.fromSeed( seedColor: Colors.deepPurple, brightness: Brightness.light, ), useMaterial3: true, inputDecorationTheme: InputDecorationTheme( border: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(12)), ), ), ), darkTheme: ThemeData( colorScheme: ColorScheme.fromSeed( seedColor: Colors.deepPurple, brightness: Brightness.dark, ), useMaterial3: true, inputDecorationTheme: InputDecorationTheme( border: OutlineInputBorder( borderRadius: const BorderRadius.all(Radius.circular(12)), ), ), ), themeMode: ThemeMode.system, home: const Shell(), ); } }