summaryrefslogtreecommitdiff
path: root/lib/screens/level_selection.dart
diff options
context:
space:
mode:
authorOrangerot <purple@orangerot.dev>2025-01-13 15:24:58 +0100
committerOrangerot <purple@orangerot.dev>2025-01-13 15:24:58 +0100
commitfc951a4df5ff229c37a66bb0e8ed3d1f5a949ce1 (patch)
tree366cb214f7e6221de9872fe359898beaf4e67e46 /lib/screens/level_selection.dart
parentd52f60ef9272920dc460a1d60abca0f0379074ea (diff)
style: small refactor in level_selection
Diffstat (limited to 'lib/screens/level_selection.dart')
-rw-r--r--lib/screens/level_selection.dart25
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/screens/level_selection.dart b/lib/screens/level_selection.dart
index 1b5d0d1..5fafe3f 100644
--- a/lib/screens/level_selection.dart
+++ b/lib/screens/level_selection.dart
@@ -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)),
);
}
}