style: small refactor in level_selection

This commit is contained in:
Orangerot 2025-01-13 15:24:58 +01:00
parent d52f60ef92
commit fc951a4df5
2 changed files with 16 additions and 11 deletions

View file

@ -78,6 +78,16 @@ class _LevelSelectionState extends State<LevelSelection> {
}
}
void filterLevels(String input) {
setState(() {
stepmaniaCoursesFoldersFiltered = stepmaniaCoursesFolders
.where((simfile) => simfile.tags["TITLE"]!
.toLowerCase()
.contains(input.toLowerCase()))
.toList();
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -111,15 +121,7 @@ class _LevelSelectionState extends State<LevelSelection> {
padding:
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 0.0),
child: TextField(
onChanged: (input) {
setState(() {
stepmaniaCoursesFoldersFiltered = stepmaniaCoursesFolders
.where((simfile) => simfile.tags["TITLE"]!
.toLowerCase()
.contains(input.toLowerCase()))
.toList();
});
},
onChanged: filterLevels,
decoration: InputDecoration(
// icon: Icon(Icons.search),
hintText: 'Search'),
@ -151,7 +153,10 @@ class _LevelSelectionState extends State<LevelSelection> {
}
}),
floatingActionButton: FloatingActionButton(
onPressed: () => {selectFolder()}, child: Icon(Icons.add)),
onPressed: () {
selectFolder();
},
child: Icon(Icons.add)),
);
}
}

View file

@ -40,7 +40,7 @@ class _ESenseConnectDialogState extends State<ESenseConnectDialog> {
actions: <Widget>[
TextButton(
onPressed: () => Navigator.pop(context, 'Cancel'),
child: const Text('Discard'),
child: const Text('Close'),
),
TextButton(
onPressed: () => widget.connect(eSenseDeviceName),