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

fix: Svg pictures aren't rendered in CI mode #73

Open
1 task done
mhnowak opened this issue Aug 19, 2022 · 4 comments
Open
1 task done

fix: Svg pictures aren't rendered in CI mode #73

mhnowak opened this issue Aug 19, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@mhnowak
Copy link

mhnowak commented Aug 19, 2022

Is there an existing issue for this?

  • I have searched the existing issues.

Version

0.4.1

Description

Svg pictures aren't rendered correctly in CI mode. They work fine in macOS, but once you fit them with widgets with size below them they appear weirdly.

I'm using flutter_svg: 1.1.4

Steps to reproduce

  1. Create a golden test with this widget:
Scaffold(
  body: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        SvgPicture.asset(
          R.ILLUSTRATIONS_GENERIC_ERROR,
          fit: BoxFit.fitWidth,
        ),
        const SizedBox(height: 84),
      ],
  ),
);
  1. Run flutter test --update-goldens - when you open the generated image that's the effect:
    comments_page_error

I've also attached the svg picture I'm generating the svg with.
generic_error

Expected behavior

The generated golden should be identical to macOS one.
comments_page_error

Screenshots

No response

Additional context and comments

I'm using flutter 3.0.5

@mhnowak mhnowak added the bug Something isn't working label Aug 19, 2022
@mhnowak
Copy link
Author

mhnowak commented Aug 19, 2022

Update: it seems like removing this line from column solves this issue

      mainAxisAlignment: MainAxisAlignment.center,

I don't yet know why tho.

@Kirpal
Copy link
Collaborator

Kirpal commented Aug 19, 2022

Hi @mhnowak, thanks for the issue! I think this is caused by the method we use to block out the text affecting the layout of the svg. So in that case it would make sense that changing the alignment might fix it, but there's still an underlying issue to fix there. Unfortunately I don't have a good workaround at the moment, but will continue to update the issue as I figure out more details.

@Giuspepe
Copy link
Contributor

Giuspepe commented Sep 15, 2022

I've encountered the same issue and another problem I have found with regards to this is that running goldenTest without a GoldenTestGroup also causes a similar issue. I added my example here, hope it helps: https://github.com/Giuspepe/alchemist/tree/example-svg-bug/example/test/svg_bug

I'm using Flutter 3.3.1 on channel stable.

@karvulf
Copy link

karvulf commented Apr 26, 2023

Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants