mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
Player._playTrack unsafe null modifier removed
SpotifyDI was using ChangeNotifier as mixin & wasn't extending
This commit is contained in:
parent
25854c843f
commit
e6daba77bd
@ -138,7 +138,7 @@ class _PlayerState extends State<Player> with WidgetsBindingObserver {
|
|||||||
Future _playTrack(Track currentTrack, Playback playback) async {
|
Future _playTrack(Track currentTrack, Playback playback) async {
|
||||||
try {
|
try {
|
||||||
if (currentTrack.id != _currentTrackId) {
|
if (currentTrack.id != _currentTrackId) {
|
||||||
Uri? parsedUri = Uri.tryParse(currentTrack.uri!);
|
Uri? parsedUri = Uri.tryParse(currentTrack.uri ?? "");
|
||||||
if (parsedUri != null && parsedUri.hasAbsolutePath) {
|
if (parsedUri != null && parsedUri.hasAbsolutePath) {
|
||||||
await player
|
await player
|
||||||
.setAudioSource(
|
.setAudioSource(
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:spotify/spotify.dart';
|
import 'package:spotify/spotify.dart';
|
||||||
|
|
||||||
class SpotifyDI with ChangeNotifier {
|
class SpotifyDI extends ChangeNotifier {
|
||||||
SpotifyApi _spotifyApi;
|
SpotifyApi _spotifyApi;
|
||||||
|
|
||||||
SpotifyDI(this._spotifyApi);
|
SpotifyDI(this._spotifyApi);
|
||||||
|
Loading…
Reference in New Issue
Block a user