相关疑难解决方法(0)

flutter:获取手势检测器的本地位置

我使用平移更新无法在手势检测器小部件上获取实际的本地位置

这是我的示例代码

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
         ),
       ),
    ),
  ),  
)
Run Code Online (Sandbox Code Playgroud)

当我打印全局位置和本地位置的偏移量时,它们两个的值相同。结果是它被绘制在我的Container小部件外部。有什么我想得到的本地职位吗?

dart flutter

6
推荐指数
1
解决办法
2358
查看次数

标签 统计

dart ×1

flutter ×1