Skip to content

Commit

Permalink
Fix batteryState type before envent stream fix issue #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiska committed Feb 10, 2025
1 parent 536c7f7 commit 4ed70f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/Classes/FlutterEcoModePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ public class BatteryStateStreamHandler: NSObject, FlutterStreamHandler {

@objc func batteryStateChanged(_ notification: Notification) {
let batteryState = convertBatteryState(state: UIDevice.current.batteryState)
let batteryStateString = String(describing: batteryState)
DispatchQueue.main.async {
self.eventSink?(batteryState)
self.eventSink?(batteryStateString)
}
}

Expand Down

0 comments on commit 4ed70f5

Please sign in to comment.