flutterchina / flutter_in_action_2nd

《Flutter实战 第二版》 书稿
https://book.flutterchina.club/
2.18k stars 343 forks source link

纠错: 第四章 4.7 对齐与相对定位(alignment) #197

Open zhangyyysss opened 1 year ago

zhangyyysss commented 1 year ago

书中计算转换坐标: Alignment可以通过其坐标转换公式将其坐标转为子元素的具体偏移坐标: (Alignment.xchildWidth/2+childWidth/2, Alignment.ychildHeight/2+childHeight/2)

实际上坐标转换应该与原容器大小有关: https://api.flutter-io.cn/flutter/widgets/Align-class.html https://segmentfault.com/a/1190000041631644