Better integration of filter button

This commit is contained in:
Pierre HUBERT 2022-03-24 14:55:41 +01:00
parent a29e9dcfff
commit d7b63b754f
2 changed files with 15 additions and 2 deletions

View File

@ -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(

View File

@ -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,
),
),
);
}