Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Add Windows support #43

Merged
merged 4 commits into from
May 30, 2022
Merged

Add Windows support #43

merged 4 commits into from
May 30, 2022

Conversation

ebraminio
Copy link
Contributor

@ebraminio ebraminio commented May 30, 2022

Copy link
Contributor

@guidezpl guidezpl left a comment

Choose a reason for hiding this comment

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

Awesome!

A few things missing:

  • I think it's worth it to update the README usage section. I would mention Android in what's there currently, and then add a link to the accent_color.dart example:
## Usage
See this [complete example] for obtaining dynamic colors on Android, creating
harmonized color schemes, and harmonizing custom colors.

See this [example] for obtaining the macOS/Windows accent color.
  • CHANGELOG and pubspec need a minor version bump
  • Update the dynamic_color_builder_test.dart test

lib/src/dynamic_color_plugin.dart Outdated Show resolved Hide resolved
lib/src/dynamic_color_plugin.dart Outdated Show resolved Hide resolved
lib/src/dynamic_color_plugin.dart Outdated Show resolved Hide resolved
example/lib/control_accent_color.dart Outdated Show resolved Hide resolved
example/lib/control_accent_color.dart Outdated Show resolved Hide resolved
void DynamicColorPlugin::HandleMethodCall(
const flutter::MethodCall<flutter::EncodableValue> &method_call,
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
if (method_call.method_name().compare("getControlAccentColor") == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (method_call.method_name().compare("getControlAccentColor") == 0) {
if (method_call.method_name().compare("getAccentColor") == 0) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you like to rename the one in macOS plugin also?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, with plugins, a single API for multiple platforms is always better.

Copy link
Contributor Author

@ebraminio ebraminio May 30, 2022

Choose a reason for hiding this comment

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

Agreed, just something to think about in the future, do you like the idea of providing it for the Android one also, maybe it can reuse accent1_500.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, with plugins, a single API for multiple platforms is always better.

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, thought about it, but there's no prescribed accent color for Android. I do think there's an optimization to be made for this package's users, who just want a color scheme per platform, and don't care whether it came from a single color (macOS/Windows) or is some intermediate form (Android's CorePalette).

Copy link
Contributor

Choose a reason for hiding this comment

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

What am I saying, that's what DynamicColorBuilder is. 😄

windows/dynamic_color_plugin.cpp Outdated Show resolved Hide resolved
@ebraminio
Copy link
Contributor Author

ebraminio commented May 30, 2022

A few things missing:

Done, hopefully.

Copy link
Contributor

@guidezpl guidezpl left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for getting this done.

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

Successfully merging this pull request may close these issues.

Add support for Window accent color
2 participants