diff options
author | Orangerot <purple@orangerot.dev> | 2024-12-23 03:18:39 +0100 |
---|---|---|
committer | Orangerot <purple@orangerot.dev> | 2024-12-23 03:18:39 +0100 |
commit | 1415f91fa5f32b53f69332c7f1ef1129a3d9f454 (patch) | |
tree | b8988e9a40fe01c38806aea422945b33f1a0424f /lib/level_selection.dart | |
parent | d397b62b5b6f6db45a2cc0ae6ca4e03ff04c54b2 (diff) |
feat: play audio on entering level and pause button
Diffstat (limited to 'lib/level_selection.dart')
-rw-r--r-- | lib/level_selection.dart | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/level_selection.dart b/lib/level_selection.dart index cc79911..e2cdcbe 100644 --- a/lib/level_selection.dart +++ b/lib/level_selection.dart @@ -81,12 +81,13 @@ class _LevelSelectionState extends State<LevelSelection> { separatorBuilder: (BuildContext context, int index) => const Divider(), itemBuilder: (context, index) { - String thumbnailPath = - Directory(stepmaniaCoursesFolders[index].path) - .listSync() - .firstWhere((file) => file.path.toLowerCase().endsWith('banner.png'), + String thumbnailPath = Directory( + stepmaniaCoursesFolders[index].path) + .listSync() + .firstWhere( + (file) => file.path.toLowerCase().endsWith('banner.png'), orElse: () => File('')) - .path; + .path; return ListTile( leading: Image.file(File(thumbnailPath)), trailing: Icon(Icons.play_arrow), @@ -96,7 +97,10 @@ class _LevelSelectionState extends State<LevelSelection> { onTap: () => Navigator.push( context, MaterialPageRoute( - builder: (BuildContext context) => Level())), + builder: (BuildContext context) => Level( + stepmaniaFolderPath: + stepmaniaCoursesFolders[index].path, + ))), ); }, ); |