📜  颤振长按振动 - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:08.451000             🧑  作者: Mango

代码示例1
import 'package:flutter/services.dart';

class MyVibrateButton extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: GestureDetector(
        onLongPress: () => HapticFeedback.vibrate(),
        child: Container(color: Colors.blue, width: 100.0, height: 50.0),
      ),
    );
  }
}