Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(battery_plus): Added power source type of how the device is powered. #2612

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

devaronius
Copy link

@devaronius devaronius commented Feb 23, 2024

Description

This PR updates the battery_plus plugin to handle power source type fetching on mobile.
When you request the PowerSource type from the plugin it will try to get the source type from the intent battery changed extras, to indicate if the power source is AC, USB, Wireless or by battery.

Motivation

We work with mobile scanner devices that run on Android and are socketed in Cradles for their charging and release to the users.
There is no communication between the cradle and the scanner to detect if the scanner is in the cradle except for its power state. With the current version of the battery_plus package, we can detect whether the system is charging. But for development purposes, as an example, it is possible to also have a USB cable attached to the device.
This will break the charging logic, and we require a second parameter to determine if the power source is our USB cable, the cradle, or the battery.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

@vbuberen
Copy link
Collaborator

Thanks for your contribution. Will you also provide an implementation of this feature for iOS? If this feature is planned to cover only Android we won't be able to accept it as stated in our Contributor guide.

@devaronius
Copy link
Author

Thanks for your contribution. Will you also provide an implementation of this feature for iOS? If this feature is planned to cover only Android we won't be able to accept it as stated in our Contributor guide.

Hi @vbuberen, I planned to implement the iOS feature this weekend.
For Web and Windows, I do need to-do some research on how to accomplice this feature.

If macOS uses the same implementation as iOS, then this feature update will be planned for next weekend.

@vbuberen
Copy link
Collaborator

Thanks for info. No rush from our side at all. Next release for plugins is planned to be somewhere in March, depending on when other desired features/fixes are ready. So take you time.
From my side I just wanted to be sure that not only Android will get this feature.

@vbuberen
Copy link
Collaborator

@devaronius Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants