selectionFeedback static method
void
selectionFeedback()
轻量级选择反馈,适用于拖动等高频手势场景
使用 HapticFeedback.selectionClick 替代循环振动,避免 Future 积压。
Implementation
static void selectionFeedback() {
final now = DateTime.now();
if (_lastVibrationTime == null ||
now.difference(_lastVibrationTime!) >=
const Duration(milliseconds: defaultMinVibrationInterval)) {
HapticFeedback.selectionClick();
_lastVibrationTime = now;
}
}