Flutter 的用户行为既不是原生 Button 点击,也不是 Web DOM 点击。一次操作首先只是指针事件和坐标,SDK 需要回到 Flutter 的 HitTest、Widget、Element、RenderObject 体系里识别语义。因此 Action 自动识别不是仅调用 start() 就能完成,需要把目标组件树包裹在 AlibabaCloudActionCapture 下:
AlibabaCloudActionCapture(
child: MaterialApp(
navigatorObservers: [
AlibabaCloudRUMNavigationObserver(enablePagePerf: true),
],
home: HomePage(),
),
);
对于关键业务操作,建议不要只依赖默认控件识别,而是通过 ActionAnnotation 补充业务语义:
ActionAnnotation(
description: 'Submit Button',
attributes: {
'screen': 'order_detail',
'action': 'submit_order',
'actor_type': 'human',
},
child: ElevatedButton(
onPressed: _submitOrder,
child: Text('Submit'),
),
);
这样在分析「点击后无响应」时,看到的就不只是一次 tap,而是能结合 Action、业务事件、后续 Resource、LongTask 和 Error 还原完整执行链路。




