Skip to content

Conversation

rktejesh
Copy link

@rktejesh rktejesh commented Oct 5, 2021

Description

Added additional methods to the present battery api to get device battery information such as Battery Capacity, Charging Status, Charge Time Remaining, Current Average, Current Now, Health, Plugged Status, Battery Presence, Scale, Remaining Energy, Technology, Temperature, Voltage.
This change has only been added to android. Other platforms are yet to be implemented

Related Issues

This PR partially closes #460

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I am willing to follow-up on review comments in a timely manner.

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 a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@rktejesh rktejesh closed this Oct 5, 2021
@rktejesh rktejesh reopened this Oct 5, 2021
@miquelbeltran
Copy link
Member

This change has only been added to android. Other platforms are yet to be implemented

I would prefer that we don't add new functionality if it is not at least covering both Android and iOS (the two main platforms). Ideally with a plan to cover the six of them. Throwing a missing implementation exception leads to bad user experience. I already faced that with the network_info_plus missing some calls on MacOS for example.

We should probably clarify this in the CONTRIBUTING document.

Thoughts? @mhadaily @elias8 @jpnurmi

@mhadaily
Copy link
Member

mhadaily commented Oct 6, 2021

Yes I agree @miquelbeltran I hope you can take care of it @rktejesh

also build failed please double-check check formatting.

@rktejesh
Copy link
Author

rktejesh commented Oct 6, 2021

@miquelbeltran I agree with you. I plan on adding it to other platforms as well. But as for iOS devices due to Apple restrictions it is not possible to retrieve the data from public API's and App store may block the app if we use any private API-See and also this.
Do I need to create separte issues for the platforms or continue on this PR?

As for the build failed I assume you are talking about the second test. I have updated two plugins (battery_plus and battery_plus_platform_interface) and since the second test doesn't melos bootstrap the test has not passed.

Could you please also add the Hacktoberfest tags. Thanks.

@miquelbeltran
Copy link
Member

IMO if those values can only be retrieved for Android then I would encourage you to create an independent plugin for android specific functionality like android_alarm_manager, e.g. android_battery_info.

I will add the hacktoberfest tags but we cannot merge this PR I think.

@miquelbeltran miquelbeltran added Hacktoberfest Issues taking part in Hacktoberfest hacktoberfest-accepted labels Oct 6, 2021
@rktejesh
Copy link
Author

rktejesh commented Oct 6, 2021

I am positive that it can be implemented in all the other platforms. I found some resources to implement this and I dont think it should be an issue. We can go about this by creating a new branch and keep working on it until the final release. Wdyt?

Windows
MacOS
Linux
Web

@rktejesh rktejesh closed this Jan 10, 2022
@twogood
Copy link

twogood commented Apr 3, 2022

@rktejesh did you ever follow through on this? Such a waste to throw away your Android work just because the other platforms are not yet implemented.

@rktejesh
Copy link
Author

rktejesh commented Apr 4, 2022

@twogood haven't given it much thought after that. Is it still viable to create this into a standalone plugin only for Android?

@twogood
Copy link

twogood commented Apr 4, 2022

@twogood haven't given it much thought after that. Is it still viable to create this into a standalone plugin only for Android?

Even if you don't want to maintain it, maybe just add it to its own GitHub repository somewhere.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Hacktoberfest Issues taking part in Hacktoberfest hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Suggestion] More information on all platforms
4 participants