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

Incorrect android_12 check for image_dark #347

Closed
Hallot opened this issue May 10, 2022 · 4 comments
Closed

Incorrect android_12 check for image_dark #347

Hallot opened this issue May 10, 2022 · 4 comments

Comments

@Hallot
Copy link
Contributor

Hallot commented May 10, 2022

Describe the bug
Incorrect error message check when trying to set android_12 image_dark value.

The following configuration:

flutter_native_splash:
  background_image: assets/images/app_splash.png
  background_image_dark: assets/images/app_splash_dark.png
  android_12:
    image: assets/images/app_icon.png
    icon_background_color: #eeeeee
    image_dark: assets/images/app_icon_dark.png
    icon_background_color_dark: #202020
  android: true
  ios: true
  web: false

Results in:
"Your flutter_native_splash section contains android_12:icon_background_color_dark but does not contain a color_dark or a background_image_dark."

To Reproduce
Copy config above and:
flutter pub run flutter_native_splash:create

Expected behavior
No error is reported.

Additional context
Having a look at the code, this sections looks wrong (https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/cli_commands.dart l309):

if (android12Config.containsKey('image_dark') &&
        !config.containsKey('color_dark') &&
        !config.containsKey('icon_background_color_dark')) {
      print(
        'Your `flutter_native_splash` section contains '
        '`android_12:icon_background_color_dark` but does not contain a '
        '`color_dark` or a `background_image_dark`.',
      );
      exit(1);
    }

It's looking for a icon_background_color_dark config in the top level, but there is no such config, it is under the android_12 namespace. Second, the error message is wrong (most likely copied from the first check just above).
I am not exactly sure what this check is supposed to ensure though.

@jonbhanson
Copy link
Owner

Thanks for the ticket and checking into this. I will address this in the next release.

@sureace
Copy link

sureace commented May 12, 2022

Hi @jonbhanson ,
We are also facing the same issue. Is there any work around now to resolve this issue until you provide permanent fix
Thank you
Sureace

@Hallot
Copy link
Contributor Author

Hallot commented May 12, 2022

@sureace Simply delete the check for now.

@jonbhanson
Copy link
Owner

I will push an update out soon to resolve 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

3 participants