feat(battery_plus): Add battery save mode check on MacOS #3332
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
While testing SPM for
![Screenshot 2024-10-21 at 11 07 11](https://private-user-images.githubusercontent.com/13467769/378337329-ce9c88aa-7565-4122-8c92-009b3d11452c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0OTIzOTMsIm5iZiI6MTczOTQ5MjA5MywicGF0aCI6Ii8xMzQ2Nzc2OS8zNzgzMzczMjktY2U5Yzg4YWEtNzU2NS00MTIyLThjOTItMDA5YjNkMTE0NTJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDAwMTQ1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIyYjIzMDllZmZlNmUwNzExMjM3MWQwNzBmZWNhZmJlNWNkOGFkOWFmNjQzNDlkMTJjMDJlMGEyODg5Y2M1ZDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nvuPKVjOIs-uhZLaaB5Y3EGzH6Zwr32YkclyojS-8gs)
![Screenshot 2024-10-21 at 11 07 25](https://private-user-images.githubusercontent.com/13467769/378337339-46b3bc00-3722-49d3-8bcf-0ab645394215.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0OTIzOTMsIm5iZiI6MTczOTQ5MjA5MywicGF0aCI6Ii8xMzQ2Nzc2OS8zNzgzMzczMzktNDZiM2JjMDAtMzcyMi00OWQzLThiY2YtMGFiNjQ1Mzk0MjE1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDAwMTQ1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIzOGFmNDY0MGIzMzk0MWU5NTNlMWUyZDc2ZDhkMTNmYjQyNTBmODg4NDQ3NDM3YmRjODMwYzYxMDU3MzdmY2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Zw6wUPa7BDPaHxvp-OIgwT6CxkPdHBU6Dca1zoFbkbA)
battery_plus
was surprised that the check for battery save mode throwsUnimplemented....
on MacOS, because such check is available in MacOS since version 12.0: https://developer.apple.com/documentation/foundation/processinfo/1617047-islowpowermodeenabledThis PR adds implementation for this check and it seems to work fine:
Checklist
CHANGELOG.md
nor the plugin version inpubspec.yaml
files.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?
!
in the title as explained in Conventional Commits).