Skip to content

flutter: skip Column wrap if child is Column - #191

Merged
bernaferrari merged 1 commit into
bernaferrari:refactorfrom
ZeroNetX:fix-double-column
Mar 18, 2025
Merged

bernaferrari merged 1 commit into
bernaferrari:refactorfrom
ZeroNetX:fix-double-column

Conversation

@canewsin

@canewsin canewsin commented Mar 9, 2025

Copy link
Copy Markdown
Contributor

Skip generating empty Column if child is already a Column

@bernaferrari

Copy link
Copy Markdown
Owner

This one could be a bit dangerous, could you give me an example of figma layout did outputted this?

@canewsin

Copy link
Copy Markdown
Contributor Author

This one could be a bit dangerous

This won't because I was just replacing hard coded code which only contains single child

 result = generateWidgetCode("Column", { children: [result] });

In flutter Column with single child doesn't have any layout impact on child that too without properties.

I do check if result child Column

if (!result.startsWith("Column")) {
    result = generateWidgetCode("Column", { children: [result] });
}

@canewsin
canewsin force-pushed the fix-double-column branch from f7c61ec to 33b5099 Compare March 15, 2025 04:30
@canewsin

Copy link
Copy Markdown
Contributor Author

@bernaferrari rebased

@bernaferrari
bernaferrari merged commit 2465711 into bernaferrari:refactor Mar 18, 2025
@canewsin
canewsin deleted the fix-double-column branch March 18, 2025 06:24
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

Successfully merging this pull request may close these issues.

2 participants