Skip to content

Commit d979616

Browse files
committed
fix analyze issues
1 parent b23cbbb commit d979616

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

example/lib/main.dart

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class HomeState extends State<Home> {
3939
lineLength: 120, // width of the output
4040
colors: true, // Colorful log messages
4141
printEmojis: true, // Print an emoji for each log message
42-
printTime: true,
4342
),
4443
);
4544

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

768767
Future<void> checkIfAppIsActive(BuildContext context) async {
769768
try {
770-
await SpotifySdk.isSpotifyAppActive.then((isActive) {
771-
final snackBar = SnackBar(
772-
content: Text(isActive
773-
? 'Spotify app connection is active (currently playing)'
774-
: 'Spotify app connection is not active (currently not playing)'));
775-
776-
ScaffoldMessenger.of(context).showSnackBar(snackBar);
777-
});
769+
final isActive = await SpotifySdk.isSpotifyAppActive;
770+
_showSnackBar(isActive);
778771
} on PlatformException catch (e) {
779772
setStatus(e.code, message: e.message);
780773
} on MissingPluginException {
781774
setStatus('not implemented');
782775
}
783776
}
784777

778+
void _showSnackBar(bool isActive) {
779+
final snackBar = SnackBar(
780+
content: Text(isActive
781+
? 'Spotify app connection is active (currently playing)'
782+
: 'Spotify app connection is not active (currently not playing)'),
783+
);
784+
785+
ScaffoldMessenger.of(context).showSnackBar(snackBar);
786+
}
787+
785788
void setStatus(String code, {String? message}) {
786789
var text = message ?? '';
787790
_logger.i('$code$text');

lib/spotify_sdk_web.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@JS()
2-
library spotify_sdk_web;
2+
library;
33

44
import 'dart:async';
55
import 'dart:convert';

0 commit comments

Comments
 (0)