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

Make BoxyFlex Implement Flex #26

Closed
caseycrogers opened this issue Aug 27, 2023 · 1 comment
Closed

Make BoxyFlex Implement Flex #26

caseycrogers opened this issue Aug 27, 2023 · 1 comment

Comments

@caseycrogers
Copy link

caseycrogers commented Aug 27, 2023

Packages like gap and flutter_gutter use Flex.direction/RenderFlex.direction to determine if they are in a vertically or horizontally aligned layout.

BoxyFlex and BoxyRenderFlex should implement their Flutter counterparts so that these packages' widgets will work properly with BoxyRow and BoxyColumn out of the box(y).

Here's a related Flutter/flutter issue that if accepted would change how this should be implemented:
flutter/flutter#133394

@pingbird
Copy link
Owner

pingbird commented Aug 27, 2023

This can't be done without breaking boxy when the framework changes Flex, also, walking the tree to check the runtime type of ancestors is probably a bad idea. I'll gladly implement a directionality interface if added to the framework, I think your best bet until then is a dynamic call at layout time:

var direction = defaultDirection
try {
  direction = (parent as dynamic).direction as Axis;
} catch (e) {}

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