hackware1993 / Flutter_ConstraintLayout

A super powerful Stack, build flexible layouts with constraints. Similar to ConstraintLayout for Android and AutoLayout for iOS. But the code implementation is much more efficient, it has O(n) layout time complexity and no linear equation solving is required.
MIT License
489 stars 36 forks source link

margin left not work, when centerHorizontalTo parent #13

Closed DonaldDu closed 2 years ago

DonaldDu commented 2 years ago

Widget addressView() { return Text( '当前位置:地址1111111111111111111100000002222222222222222222222222220000000', textAlign: TextAlign.center, style: TextStyle(fontSize: 12), ).applyConstraint( id: address, centerHorizontalTo: parent, top: center.bottom, margin: const EdgeInsets.only(top: 24, left: 50,right: 50), ); }

hackware1993 commented 2 years ago

左右的 margin 都一样,你用 centerHorizontalTo parent 看不出效果啊