[battery_plus] Platform support for battery_plus in README is wrong
about battery_plus support for Linux ( mentioned in: https://github.com/fluttercommunity/plus_plugins#battery_plus )
listening to batteryState works on Android device,
batteryStateSubscription =
battery.onBatteryStateChanged.listen((BatteryState state) {
batteryState = state;
notifyListeners();
});
works fine on Android, but in Linux (Ubuntu 20.04) throws missing plugin exceptions:
flutter: ══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════ flutter: The following MissingPluginException was thrown while activating platform stream on channel flutter: plugins.flutter.io/charging: flutter: MissingPluginException(No implementation found for method listen on channel flutter: plugins.flutter.io/charging)
Here is my flutter doctor -v
Flutter (Channel dev, 1.24.0-3.0.pre, on Linux, locale en_US.UTF-8) • Flutter version 1.24.0-3.0.pre at /home/thomas/development/flutter • Framework revision 2783f8e2e1 (5 days ago), 2020-10-22 09:36:06 -0700 • Engine revision defa8be2b1 • Dart version 2.11.0 (build 2.11.0-242.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) • Android SDK at /home/thomas/Android/Sdk • Platform android-29, build-tools 29.0.3 • Java binary at: /home/thomas/development/android-studio/jre/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted.
[✓] Chrome - develop for the web • Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop • clang version 10.0.0-4ubuntu1 • cmake version 3.16.3 • ninja version 1.10.0 • pkg-config version 0.29.1
[✓] Android Studio • Android Studio at /home/thomas/development/android-studio • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • android-studio-dir = /home/thomas/development/android-studio • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] IntelliJ IDEA Community Edition (version 2020.2) • IntelliJ at /home/thomas/idea-IC/idea-IC-202.6397.94 • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin version 202.7206
[✓] Connected device (3 available) • Linux (desktop) • linux • linux-x64 • Linux • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 85.0.4183.83
Looks like a typo on the README, as there's no battery_plus_linux plugin as it is still pending to be merged: https://github.com/fluttercommunity/plus_plugins/pull/3
However the plugin supports Windows and MacOS which are not listed.
@mhadaily the website would need to be updated as well to reflect the current plugin support.
Sorry for the confusion. There was a misunderstanding. Linux support for battery & connectivity was originally implemented in September, but there have been several impediments related to dependencies that prevented the Linux plugins from being merged... Technically it should be possible to use them from the Git repo directly, but they must be listed in the main plugin's pubspec which gets a bit clumsy.
@miquelbeltran I updated the website. I'll send a PR to add a website to this mono repo.
all good now, thank you!
Thanks. Look forward to the Linux support (plugin) being added back to the released battery_plus plugin.