-
Notifications
You must be signed in to change notification settings - Fork 29.7k
EdgeInsets => EdgeInsetsGeometry #16329
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
Conversation
…nables to use EdgeInsetsDirectional as well and should be useful for Right-To-Left scenarios.
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
|
CLAs look good, thanks! |
|
Where does it get resolved? Or is it passed through to something that already accepts EdgeInsetsGeometry? |
|
(this will need tests) |
|
For almost every padding enabled widget in Flutter we are able to set a padding either from a left-top-right-bottom or start-top-end-bottom because the padding property itself is a EdgeInsetsGeometry and we can assign values of type EdgeInsets or EdgeInsetsDirectional to it (child classes). For InputDecorator this was not the case and i believe it is an implementation mistake. Currently we are unable to do the following: Above code will cause a compile-time error. |
|
I think this is a good improvement to make however I don't think this is the right way to make it. InputDecoration.contentPadding and InputDecorationTheme.contentPadding should be EdgeInsetsDirectional and _InputDecoratorState should resolve contentPadding based on Directionality.of(). |
|
Where are the |
|
They're directly used (in a way where start/end resolution matters) by the InputDecorator's renderer at |
|
Ah yeah in that case this patch will indeed not work, and we'll have to resolve them before use. I'm surprised the code above compiles without analyzer warnings, actually. |
|
@xclud Will you be able to continue working on this (to address the comments above)? It's totally fine if not; we can take it over (though it might take longer). I'm just asking because I'm trying to clean out our review queue. |
|
@Hixie I want to bring your attention to the field type of On the other hand, for the rest of the Widgets
I believe the |
|
Yes, it's definitely a mistake. The fix is not just to change the type though. We have to change the type, and resolve them (using |
|
I'm making an InputDecoration change now, will fix this as well. |
|
@HansMuller Is this resolved now? |
|
This was fixed in #17292 |
|
Thank you for the great job. Fixed. |
Use the more generic EdgeInsetsGeometry instead of EdgeInsets. This enables to use EdgeInsetsDirectional as well and should be useful for Right-To-Left scenarios.