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 { } } + 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 { 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 { } }), floatingActionButton: FloatingActionButton( - onPressed: () => {selectFolder()}, child: Icon(Icons.add)), + onPressed: () { + selectFolder(); + }, + child: Icon(Icons.add)), ); } } diff --git a/lib/widgets/esense_connect_dialog.dart b/lib/widgets/esense_connect_dialog.dart index b598174..bb9305b 100644 --- a/lib/widgets/esense_connect_dialog.dart +++ b/lib/widgets/esense_connect_dialog.dart @@ -40,7 +40,7 @@ class _ESenseConnectDialogState extends State { actions: [ TextButton( onPressed: () => Navigator.pop(context, 'Cancel'), - child: const Text('Discard'), + child: const Text('Close'), ), TextButton( onPressed: () => widget.connect(eSenseDeviceName),