diff --git a/lib/homepage.dart b/lib/homepage.dart index 3fe37e4afe443b29a839e260d19191fdadd65546..1d0435f6cb4a2b8a18f469092051dc6a06f18cd4 100644 --- a/lib/homepage.dart +++ b/lib/homepage.dart @@ -156,7 +156,7 @@ class HomePage extends StatelessWidget { } } - + //Todo Daniel Future<void> queue(String songId) async { try { await SpotifySdk.queue( @@ -168,9 +168,10 @@ class HomePage extends StatelessWidget { } } - Future<void> play() async { + //Todo Daniel + Future<void> play(String songId) async { try { - await SpotifySdk.play(spotifyUri: 'spotify:track:0RT1qESYHlNcUJI0Yo5Hzl'); + await SpotifySdk.play(spotifyUri: 'spotify:track:$songId'); } on PlatformException catch (e) { setStatus(e.code, message: e.message); } on MissingPluginException { @@ -290,21 +291,3 @@ class ControlButtons extends StatelessWidget { } } } - -Color darken(Color color, [double amount = .1]) { - assert(amount >= 0 && amount <= 1); - - final hsl = HSLColor.fromColor(color); - final hslDark = hsl.withLightness((hsl.lightness - amount).clamp(0.0, 1.0)); - - return hslDark.toColor(); -} - -Color ligten(Color color, [double amount = .1]) { - assert(amount >= 0 && amount <= 1); - - final hsl = HSLColor.fromColor(color); - final hslLight = hsl.withLightness((hsl.lightness + amount).clamp(0.0, 1.0)); - - return hslLight.toColor(); -} diff --git a/lib/main.dart b/lib/main.dart index 276c2789f3c0459d878391deb20840fffde1de87..c173866cb8769cca8da3031943e5e5d720c59e55 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -163,3 +163,21 @@ class MusicBar extends StatelessWidget { } } } + +Color darken(Color color, [double amount = .1]) { + assert(amount >= 0 && amount <= 1); + + final hsl = HSLColor.fromColor(color); + final hslDark = hsl.withLightness((hsl.lightness - amount).clamp(0.0, 1.0)); + + return hslDark.toColor(); +} + +Color ligten(Color color, [double amount = .1]) { + assert(amount >= 0 && amount <= 1); + + final hsl = HSLColor.fromColor(color); + final hslLight = hsl.withLightness((hsl.lightness + amount).clamp(0.0, 1.0)); + + return hslLight.toColor(); +} \ No newline at end of file