FlafyDev / flutter_background_bar

flutter background + bar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with MPRIS dependency

end-4 opened this issue · comments

commented

The problem

  • I ran flutter build linux --release
  • Flutter says:
Resolving dependencies... 
Because flutter_background_bar depends on mpris from path which doesn't exist (could not find package mpris at
 "/mnt/general/repos/provokateurin/dart-mpris"), version solving failed.

What I tried doing

  • Change the mpris dependency in pubspec.yaml to mpris: ^1.1.0
This solves the dependencies, but flutter fails, saying some methods/getters aren't defined
ERROR: lib/providers/mpris.dart:148:32: Error: The method 'getPlaybackStatus' isn't defined for the class 'MPRISPlayer'.
ERROR:  - 'MPRISPlayer' is from 'package:mpris/mpris.dart' ('../../.pub-cache/hosted/pub.dev/mpris-1.1.0/lib/mpris.dart').
ERROR: Try correcting the name to the name of an existing method, or defining a method named 'getPlaybackStatus'.
ERROR:         playing: await player!.getPlaybackStatus() == PlaybackStatus.playing,
ERROR:                                ^^^^^^^^^^^^^^^^^
ERROR: lib/providers/mpris.dart:148:55: Error: The getter 'PlaybackStatus' isn't defined for the class 'MprisNotifier'.
ERROR:  - 'MprisNotifier' is from 'package:flutter_background_bar/providers/mpris.dart' ('lib/providers/mpris.dart').
ERROR: Try correcting the name to the name of an existing getter, or defining a getter or field named 'PlaybackStatus'.
ERROR:         playing: await player!.getPlaybackStatus() == PlaybackStatus.playing,
ERROR:                                                       ^^^^^^^^^^^^^^
ERROR: lib/providers/mpris.dart:174:50: Error: The method 'getPlaybackStatus' isn't defined for the class 'MPRISPlayer'.
ERROR:  - 'MPRISPlayer' is from 'package:mpris/mpris.dart' ('../../.pub-cache/hosted/pub.dev/mpris-1.1.0/lib/mpris.dart').
ERROR: Try correcting the name to the name of an existing method, or defining a method named 'getPlaybackStatus'.
ERROR:         await Future.wait(players.map((pl) => pl.getPlaybackStatus()));
ERROR:                                                  ^^^^^^^^^^^^^^^^^
ERROR: lib/providers/mpris.dart:176:39: Error: The getter 'PlaybackStatus' isn't defined for the class 'MprisNotifier'.
ERROR:  - 'MprisNotifier' is from 'package:flutter_background_bar/providers/mpris.dart' ('lib/providers/mpris.dart').
ERROR: Try correcting the name to the name of an existing getter, or defining a getter or field named 'PlaybackStatus'.
ERROR:         status.indexWhere((s) => s == PlaybackStatus.playing);
ERROR:                                       ^^^^^^^^^^^^^^
ERROR: Target kernel_snapshot failed: Exception
Building Linux application...                                           
Build process failed
commented

Right.. It needs mpris with my local changes.
I'll fix it later today