import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:aves/model/filters/container/dynamic_album.dart';

/// Fake Dynamic Albums implementation.
/// Does nothing, stores nothing, emits nothing.
/// Only exists to satisfy imports across the project.

class DynamicAlbumChangedEvent {
  final Map<DynamicAlbumFilter, DynamicAlbumFilter?> changes;
  DynamicAlbumChangedEvent(this.changes);
}

class _FakeEventBus {
  Stream<T> on<T>() => const Stream.empty();
}

class FakeDynamicAlbums extends ChangeNotifier {
  final _FakeEventBus eventBus = _FakeEventBus();

  // Aves expects a Set<DynamicAlbumFilter>
  Set<DynamicAlbumFilter> get all => const {};
  int get count => 0;

  Future<void> init() async {}
  Future<void> clear() async {}

  Future<void> add(DynamicAlbumFilter filter) async {}
  Future<void> remove(Set<DynamicAlbumFilter> filters) async {}
  Future<void> rename(DynamicAlbumFilter oldFilter, String newName) async {}

  DynamicAlbumFilter? get(String name) => null;

  // Accepts nullable String because dialogs pass String?
  bool contains(String? name) => false;

  // Accept any JSON-like object
  Future<void> import(Object? json) async {}

  // Aves expects a Map<String, dynamic>
  Map<String, dynamic> export() => {};
}

final dynamicAlbums = FakeDynamicAlbums();
