Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump actions/checkout from 3 to 4 in the github_actions group #220

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 12 additions & 9 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class HomeState extends State<Home> {
lineLength: 120, // width of the output
colors: true, // Colorful log messages
printEmojis: true, // Print an emoji for each log message
printTime: true,
),
);

Expand Down Expand Up @@ -767,21 +766,25 @@ class HomeState extends State<Home> {

Future<void> 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 {
setStatus('not implemented');
}
}

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');
Expand Down
2 changes: 1 addition & 1 deletion lib/spotify_sdk_web.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@JS()
library spotify_sdk_web;
library;

import 'dart:async';
import 'dart:convert';
Expand Down