From b23cbbbceabafca8c59dc7e59c1f5595fbf9948f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 06:05:39 +0000 Subject: [PATCH 1/2] Bump actions/checkout from 3 to 4 in the github_actions group Bumps the github_actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 3 to 4 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major dependency-group: github_actions ... Signed-off-by: dependabot[bot] --- .github/workflows/pull_request.yml | 4 ++-- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 125c9c7..da53b39 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,7 +5,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -25,7 +25,7 @@ jobs: pana: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 - name: Install Dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63776ae..4748831 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ jobs: pana: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 - name: Install Dependencies From d979616424a64b45a41b131cd0efd06ac13744a2 Mon Sep 17 00:00:00 2001 From: Tobias Busch Date: Thu, 3 Oct 2024 08:23:23 +0200 Subject: [PATCH 2/2] fix analyze issues --- example/lib/main.dart | 21 ++++++++++++--------- lib/spotify_sdk_web.dart | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 5b3ce9a..e585d7a 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -39,7 +39,6 @@ class HomeState extends State { lineLength: 120, // width of the output colors: true, // Colorful log messages printEmojis: true, // Print an emoji for each log message - printTime: true, ), ); @@ -767,14 +766,8 @@ class HomeState extends State { Future checkIfAppIsActive(BuildContext context) async { try { - await SpotifySdk.isSpotifyAppActive.then((isActive) { - final snackBar = SnackBar( - content: Text(isActive - ? 'Spotify app connection is active (currently playing)' - : 'Spotify app connection is not active (currently not playing)')); - - ScaffoldMessenger.of(context).showSnackBar(snackBar); - }); + final isActive = await SpotifySdk.isSpotifyAppActive; + _showSnackBar(isActive); } on PlatformException catch (e) { setStatus(e.code, message: e.message); } on MissingPluginException { @@ -782,6 +775,16 @@ class HomeState extends State { } } + void _showSnackBar(bool isActive) { + final snackBar = SnackBar( + content: Text(isActive + ? 'Spotify app connection is active (currently playing)' + : 'Spotify app connection is not active (currently not playing)'), + ); + + ScaffoldMessenger.of(context).showSnackBar(snackBar); + } + void setStatus(String code, {String? message}) { var text = message ?? ''; _logger.i('$code$text'); diff --git a/lib/spotify_sdk_web.dart b/lib/spotify_sdk_web.dart index 0d47bc6..44bcb6e 100644 --- a/lib/spotify_sdk_web.dart +++ b/lib/spotify_sdk_web.dart @@ -1,5 +1,5 @@ @JS() -library spotify_sdk_web; +library; import 'dart:async'; import 'dart:convert';