Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong theme colors #33

Closed
talamaska opened this issue Apr 18, 2024 · 1 comment
Closed

Wrong theme colors #33

talamaska opened this issue Apr 18, 2024 · 1 comment

Comments

@talamaska
Copy link
Contributor

talamaska commented Apr 18, 2024

I checked the logic. It has flaws.
First of you create a completely new dark theme from seed using the current active theme primary color, which might be a light theme primary color. Yes you set that's dark, but this seems to be broken when the primary color is dark.

I get the save button with my dark purple for light theme and dark text.

image

So I copied that function of yours showMaterialImageCropper and wrapped the MaterialImageCropperPage with a real dark theme

 builder: (context, controller) => Theme(
          data: darkTheme,
          child: MaterialImageCropperPage(
            heroTag: heroTag,
            controller: controller,
            shouldPopAfterCrop: shouldPopAfterCrop,
          ),
        ),

Typically buttons are lighter using lighter colors than light theme. Also the contrast of the text is ok, cause it is set onPrimary, onSecondary etc correctly. So I got correct themeed croppy now

image

My suggestion is to just create a theme extension for your MaterialImageCropperPage/CupertinoImageCropperPage
and give the possibly to alter colors from their theme configurations. Or avoid creating your own theme on top of wrong active theme colors, or at least give us the possibility to set primaryColor, secondaryColor, BackgroundColor, markerColor, text color for secondary and for primary buttons.

@kekland
Copy link
Owner

kekland commented Jul 20, 2024

Hi, thanks for noticing this! Yes, seems like the primary color can be darker on light themes, which I've completely overlooked. I've added a patch in the latest version and updated the code for material theme generation.

Feel free to reopen if issues still persist.

@kekland kekland closed this as completed Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants