mirror of
https://github.com/stonega/tsacdop
synced 2025-02-23 23:07:39 +01:00
* Migrate to null safety * ✨ update theme * ♻️ code clean * feat: update just audio * feat: intgrate material you design * fix: remove unused null check * fix: remove unused null check * feat: update setting pages to material you * fix: update material you theme * ✨ support use wallpaper theme * 🎨 code format * fix: set boost valumn
48 lines
1.1 KiB
Dart
48 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:tsacdop/type/search_api/search_genre.dart';
|
|
import '../type/search_api/searchpodcast.dart';
|
|
|
|
class SearchState extends ChangeNotifier {
|
|
final List<OnlinePodcast?> _subscribedList = [];
|
|
bool _update = false;
|
|
List<OnlinePodcast?> get subscribedList => _subscribedList;
|
|
bool get update => _update;
|
|
OnlinePodcast? _selectedPodcast;
|
|
OnlinePodcast? get selectedPodcast => _selectedPodcast;
|
|
Genre? _genre;
|
|
Genre? get genre => _genre;
|
|
|
|
set selectedPodcast(OnlinePodcast? podcast) {
|
|
_selectedPodcast = podcast;
|
|
notifyListeners();
|
|
}
|
|
|
|
set setGenre(Genre genre) {
|
|
_genre = genre;
|
|
notifyListeners();
|
|
}
|
|
|
|
bool isSubscribed(OnlinePodcast? podcast) =>
|
|
_subscribedList.contains(podcast);
|
|
|
|
void clearSelect() {
|
|
_selectedPodcast = null;
|
|
notifyListeners();
|
|
}
|
|
|
|
void clearList() {
|
|
_subscribedList.clear();
|
|
}
|
|
|
|
void clearGenre() {
|
|
_genre = null;
|
|
notifyListeners();
|
|
}
|
|
|
|
void addPodcast(OnlinePodcast? podcast) {
|
|
_subscribedList.add(podcast);
|
|
_update = !_update;
|
|
notifyListeners();
|
|
}
|
|
}
|