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

Light mode resources used for dark mode in some cases #368

Closed
Hallot opened this issue May 30, 2022 · 1 comment
Closed

Light mode resources used for dark mode in some cases #368

Hallot opened this issue May 30, 2022 · 1 comment

Comments

@Hallot
Copy link
Contributor

Hallot commented May 30, 2022

Describe the bug
In case background_image/background_image_dark are used, but not color or image, then the light resources for branding and background image are used in dark mode.

The issue appears to come from the following in cli_command.dart:

  if (darkImage == null && darkColor == null) {
    if (image != null) {
      darkImage = image;
    } else {
      darkColor = color;
    }
    brandingDarkImage = brandingImage;
    darkBackgroundImage = backgroundImage;
  }

In case we only set background_image_dark, then both darkImage and darkColor will be null, thus brandingDarkImage and darkBackgroundImage will be replaced by their light version.

I tried to fix it in #350, but it appears the fix was incorrect.

To Reproduce
With the following configuration

flutter_native_splash:
background_image: assets/images/app_splash.png
background_image_dark: assets/images/app_splash_dark.png

Expected behavior
The dark background image is used in dark mode when only background_image/background_image_dark are used.

@jonbhanson
Copy link
Owner

I will push an update soon that will fix this.

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