Skip to content

Conversation

@dareecu
Copy link

@dareecu dareecu commented Oct 15, 2020

Change all setting widgets to obtain coloring from "Theme.of(context)", rather than hardcoded values (except when ItemPriority is "high" or "low"; those use the original red/green specified by the clean_settings package.)

Specifically, this PR makes following changes:

  • Replaces the default behavior for obtaining colors (hardcoded into a Map based on ItemPriority) with functions taking a BuildContext (and ItemPriority if applicable), and returns a TextStyle with same font size as before, but color based on the current theme.
  • Adds a "titleStyle" and either "descriptionStyle" or "displayValueStyle" parameters to all SettingItem Widgets, these are all TextStyle objects. If one of these custom styles is used, then ItemPriority will not have an effect on coloring the relevant part of the widget. This way, developers can specify custom styles for specific elements if they wish

Below, I have attached an image showing a before and after making the changes, as well as labeling what the defaulting colors are for various elements.

newCleanSettingDemo

p.s: this is my first ever pull request! I hope I did everything right! :P

Change all setting widgets to obtain coloring from "Theme.of(context)", rather than hardcoded values (except when ItemPriority is "high" or "low". Also adds ability to specify a custom TextStyle for title and description/displayValue
@kontinuity
Copy link
Contributor

Excellent PR. Will merge and release in 0.1.6

@kontinuity kontinuity added the enhancement New feature or request label Oct 20, 2020
@kontinuity kontinuity added this to the 0.1.6 milestone Oct 20, 2020
@kontinuity kontinuity self-assigned this Oct 20, 2020
@peengle
Copy link

peengle commented Apr 6, 2021

When are you planning to release version 0.1.6?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants