Skip to content

[battery_plus_linux] rename plugin class#586

Merged
jpnurmi merged 3 commits intofluttercommunity:mainfrom
alexbatalov:battery-plus-linux-rename
Nov 2, 2021
Merged

[battery_plus_linux] rename plugin class#586
jpnurmi merged 3 commits intofluttercommunity:mainfrom
alexbatalov:battery-plus-linux-rename

Conversation

@alexbatalov
Copy link
Copy Markdown
Contributor

Description

This PR fixes naming issue in battery_plus_linux. It's pubspec.yaml states that the plugin's class name is BatteryLinux, however throughout the code it was BatteryPlusLinux. For consistency with Linux implementations of other plugins, that do not use Plus in the name, I've removed that as well (instead of just renaming plugin's class name
in pubspec.yaml).

Without this building battery_plus_example on Mac fails with:

.dart_tool/flutter_build/generated_main.dart:19:9: Error: Getter not found: 'BatteryLinux'.
        BatteryLinux.registerWith();
        ^^^^^^^^^^^^

Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in parallel

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

  • 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.

Copy link
Copy Markdown
Collaborator

@vbuberen vbuberen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this package naming was fine with Plus word in its classes and it is just the name in pubspec had to be changed instead. Same applies to other plugins where you spotted the inconsistency in naming, since these are plus plugins now, not the original ones anymore.

@mhadaily mhadaily added Hacktoberfest Issues taking part in Hacktoberfest hacktoberfest-accepted labels Oct 31, 2021
@mhadaily mhadaily requested a review from jpnurmi October 31, 2021 20:49
@mhadaily
Copy link
Copy Markdown
Member

@jpnurmi can you test and approve this?

I think we decided to name it BatteryPlus but you know it better.

@jpnurmi
Copy link
Copy Markdown
Member

jpnurmi commented Nov 1, 2021

I believe this package naming was fine with Plus word in its classes and it is just the name in pubspec had to be changed instead.

+1 for keeping the class name. The fix will be simpler, and we have been specifically renaming classes to add the Plus suffix.

Copy link
Copy Markdown
Member

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM 👍

@jpnurmi jpnurmi merged commit 4e8a312 into fluttercommunity:main Nov 2, 2021
@alexbatalov alexbatalov deleted the battery-plus-linux-rename branch November 4, 2021 06:41
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 4, 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.

4 participants