feat(services): add PlaylistService, wire into app providers
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
449fe4ce76
commit
92f565b1d4
@@ -6,6 +6,7 @@ import 'home_screen.dart';
|
||||
import 'library/database.dart';
|
||||
import 'library/library_screen.dart';
|
||||
import 'library/library_service.dart';
|
||||
import 'library/playlist_service.dart';
|
||||
import 'library/search_screen.dart';
|
||||
import 'player/audio_handler.dart';
|
||||
import 'player/mini_player.dart';
|
||||
@@ -14,11 +15,13 @@ import 'shared/theme.dart';
|
||||
late final MeloAudioHandler _handler;
|
||||
late final MeloDb _db;
|
||||
late final LibraryService _library;
|
||||
late final PlaylistService _playlists;
|
||||
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
_db = MeloDb();
|
||||
_library = LibraryService(_db);
|
||||
_playlists = PlaylistService(_db);
|
||||
_handler = await AudioService.init(
|
||||
builder: () => MeloAudioHandler(),
|
||||
config: const AudioServiceConfig(
|
||||
@@ -40,6 +43,7 @@ class MeloApp extends StatelessWidget {
|
||||
Provider<MeloAudioHandler>.value(value: _handler),
|
||||
Provider<MeloDb>.value(value: _db),
|
||||
ChangeNotifierProvider<LibraryService>.value(value: _library),
|
||||
ChangeNotifierProvider<PlaylistService>.value(value: _playlists),
|
||||
],
|
||||
child: MaterialApp(
|
||||
title: 'Melo',
|
||||
|
||||
Reference in New Issue
Block a user