From 1415f91fa5f32b53f69332c7f1ef1129a3d9f454 Mon Sep 17 00:00:00 2001 From: Orangerot Date: Mon, 23 Dec 2024 03:18:39 +0100 Subject: feat: play audio on entering level and pause button --- lib/level_selection.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/level_selection.dart') 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 { 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 { onTap: () => Navigator.push( context, MaterialPageRoute( - builder: (BuildContext context) => Level())), + builder: (BuildContext context) => Level( + stepmaniaFolderPath: + stepmaniaCoursesFolders[index].path, + ))), ); }, ); -- cgit v1.2.3