GestureDetector(
onVerticalDragUpdate: (drag) {
int sensitivity = 8;
// you can change sensitivity to what you require
if (drag.delta.dy > sensitivity) {
// call your record function
print('Recording in progress');
} else if (drag.delta.dy < -sensitivity) {
// in case you ever want to detect swipe down
}
},
child: const CircleAvatar(
backgroundColor: Colors.green,
child: Icon(
Icons.mic,
color: Colors.white,
)),
),
1条答案
按热度按时间zhte4eai1#