You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the battery_plus plugin on an Android Emulator with a neutral charging state.
The battery_plus plugin after being updated to version v5.0.1 now contains the charging state "not_charging". see. #2275
The corresponding platform interface (battery_plus_platform_interface) in its currrent version 2.0.0 is lacking this enum, leading to an ArgumentError.
File: utils.dart
BatteryState parseBatteryState(String state) {
switch (state) {
case 'full':
return BatteryState.full;
case 'charging':
return BatteryState.charging;
case 'discharging':
return BatteryState.discharging;
case 'connected_not_charging':
return BatteryState.connectedNotCharging;
case 'unknown':
return BatteryState.unknown;
default:
throw ArgumentError('$state is not a valid BatteryState.');
}
}
The initial commit contained the fix, this was however reverted by this commit: 78f44bf
[✓] Flutter (Channel stable, 3.16.3, on macOS 14.0 23A344 darwin-arm64,
locale en-DE)
• Flutter version 3.16.3 on channel stable at
/Users/felix/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b0366e0a3f (7 days ago), 2023-12-05 19:46:39
-0800
• Engine revision 54a7145303
• Dart version 3.2.3
• DevTools version 2.28.4
[✓] Android toolchain - develop for Android devices (Android SDK version
34.0.0)
• Android SDK at /Users/felix/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 15.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A507
! iOS 17.0 Simulator not installed; this may be necessary for iOS and
macOS development.
To download and install the platform, open Xcode, selectXcode>
Settings > Platforms,
and click the GET button for the required platform.
For more information, please visit:
https://developer.apple.com/documentation/xcode/installing-additi
onal-simulator-runtimes
• CocoaPods version 1.13.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google
Chrome
[✓] Android Studio (version 2023.1)
• Android Studio at /Applications/Android Studio.app/Contents
• 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
• Java version OpenJDK Runtime Environment (build
17.0.7+0-17.0.7b1000.6-10550314)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.3)
• IntelliJ at /Applications/IntelliJ IDEA.app
• 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
[✓] VS Code (version 1.85.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.78.0
[✓] Connected device (3 available)
• Android SDK built for arm64 (mobile) • emulator-5554 •
android-arm64 • Android 10 (API 29) (emulator)
• macOS (desktop) • macos • darwin-arm64
• macOS 14.0 23A344 darwin-arm64
• Chrome (web) • chrome •
web-javascript • Google Chrome 120.0.6099.71
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
Checklist before submitting a bug
I searched issues in this repository and couldn't find such bug/problem
I Google'd a solution and I couldn't find it
I searched on StackOverflow for a solution and I couldn't find it
I read the README.md file of the plugin
I'm using the latest version of the plugin
All dependencies are up to date with flutter pub upgrade
I did a flutter clean
I tried running the example project
The text was updated successfully, but these errors were encountered:
Thanks for reporting. Indeed, there is an issue as not_charging wasn't a proper name that had to be changed to better explain what is the status about. I will release a fix shortly.
Platform
Android 12
Plugin
battery_plus
Version
v5.0.1
Flutter SDK
v3.16.2
Steps to reproduce
Use the battery_plus plugin on an Android Emulator with a neutral charging state.
The battery_plus plugin after being updated to version v5.0.1 now contains the charging state "not_charging". see. #2275
The corresponding platform interface (battery_plus_platform_interface) in its currrent version 2.0.0 is lacking this enum, leading to an ArgumentError.
File: utils.dart
The initial commit contained the fix, this was however reverted by this commit: 78f44bf
Please release a hotfix.
Code Sample
No response
Logs
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean
The text was updated successfully, but these errors were encountered: