vibrate on long press flutter code example
Example: flutter longpress vibration
import 'package:flutter/services.dart';
class MyVibrateButton extends StatelessWidget {
Widget build(BuildContext context) {
return Center(
child: GestureDetector(
onLongPress: () => HapticFeedback.vibrate(),
child: Container(color: Colors.blue, width: 100.0, height: 50.0),
),
);
}
}