import 'dart:collection'; import 'package:flutter/foundation.dart'; class DownloadChangeProvider with ChangeNotifier, DiagnosticableTreeMixin { final HashSet _currentlyDownloading = HashSet(); HashSet get currentlyDownloading => _currentlyDownloading; void update(List token, bool add) { debugPrint("Downloading: $add : $token"); if (add) { _currentlyDownloading.add(token.toString()); } else { _currentlyDownloading.remove(token.toString()); } debugPrint("Downloading: $add : ${_currentlyDownloading.toList()}"); notifyListeners(); } }