【发布时间】:2018-08-24 08:12:24
【问题描述】:
我无法使用平移更新获取手势检测器小部件的真实本地位置。
new Center(
child new Container(
height: 150.0,
width: 150.0,
decoration: new BoxDecoration(
borderRadius: new BorderRadius.circular(5.0),
color: Colors.white,
),
child: new GestureDetector(
onPanUpdate: (details) => onPanUpdate(context, details),
child: new CustomPaint(
painter: new MyPainter(
points: points,
limitBottom:height - 125.0,
limitTop: 10.0,
limitLeft: 5.0,
limitRight: width - 55.0
),
),
),
),
)
当我打印全局位置的偏移量 && 本地位置时,我对它们都有相同的值。结果它被绘制在我的 Container 小部件之外。为了获得本地职位,我有什么遗漏的吗?
【问题讨论】:
-
如果您包含实际检查本地和全局位置的代码,将会很有帮助。但是我可能仍然可以告诉你发生了什么。