Better integration of filter button
This commit is contained in:
parent
a29e9dcfff
commit
d7b63b754f
@ -43,7 +43,7 @@ class _MusicPlayerState extends State<MusicPlayer> {
|
||||
final List<MusicEntry> _stack = [];
|
||||
int currMusicPos = 0;
|
||||
|
||||
var _showPlaylist = true;
|
||||
var _showPlaylist = false;
|
||||
|
||||
final _filterController = fluent.TextEditingController();
|
||||
MusicsList? _filteredList;
|
||||
@ -130,6 +130,11 @@ class _MusicPlayerState extends State<MusicPlayer> {
|
||||
});
|
||||
}
|
||||
|
||||
void _clearFilter() {
|
||||
_filterController.text = "";
|
||||
_refreshFilteredList();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
@ -285,6 +290,12 @@ class _MusicPlayerState extends State<MusicPlayer> {
|
||||
controller: _filterController,
|
||||
placeholder: "Filter list...",
|
||||
onChanged: (s) => _refreshFilteredList(),
|
||||
suffix: _filterController.text.isEmpty
|
||||
? null
|
||||
: fluent.IconButton(
|
||||
icon: const Icon(fluent.FluentIcons.clear),
|
||||
onPressed: _clearFilter,
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: ListView.builder(
|
||||
|
@ -22,7 +22,9 @@ class PlayerApp extends StatelessWidget {
|
||||
home: fluent.FluentTheme(
|
||||
child: const AppHome(),
|
||||
data: fluent.ThemeData(
|
||||
iconTheme: const IconThemeData(color: Colors.white)),
|
||||
iconTheme: const IconThemeData(color: Colors.white),
|
||||
brightness: fluent.Brightness.dark,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user