import 'package:flutter/foundation.dart';

import 'playlist.dart';


class SingleItemPlaylist implements Playlist {
  SingleItemPlaylist({required PlaylistItem item})
    : _current = ValueNotifier<PlaylistItem>(item),
      _currentIndex = ValueNotifier<int>(0);

  final ValueNotifier<PlaylistItem> _current;
  final ValueNotifier<int> _currentIndex;

  @override
  ValueListenable<PlaylistItem> get current => _current;
  @override
  ValueListenable<int> get currentIndex => _currentIndex;
  @override
  int get length => 1;
  @override
  bool get hasNext => false;
  @override
  bool get hasPrev => false;

  @override
  Future<void> next() async {}
  @override
  Future<void> prev() async {}
  @override
  Future<void> goTo(int index) async {}
  @override
  Future<void> goToItemId(String itemId) async {}

  @override
  void dispose() {
    _current.dispose();
    _currentIndex.dispose();
  }
}
