mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 09:05:10 +00:00
fix: Use HapticFeedback.selectionClick() for long press on message
This commit is contained in:
parent
03728ccb42
commit
1a655d6f72
1 changed files with 2 additions and 10 deletions
|
@ -1,13 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:swipe_to_action/swipe_to_action.dart';
|
||||
import 'package:vibration/vibration.dart';
|
||||
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/utils/date_time_extension.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:fluffychat/utils/string_color.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
import 'package:fluffychat/widgets/hover_builder.dart';
|
||||
|
@ -221,14 +220,7 @@ class Message extends StatelessWidget {
|
|||
? null
|
||||
: () {
|
||||
onSelect(event);
|
||||
// Android usually has a vibration effect on long press:
|
||||
if (PlatformInfos.isAndroid) {
|
||||
Vibration.hasVibrator().then((has) {
|
||||
if (has == true) {
|
||||
Vibration.vibrate(duration: 50);
|
||||
}
|
||||
});
|
||||
}
|
||||
HapticFeedback.selectionClick();
|
||||
},
|
||||
child: AnimatedOpacity(
|
||||
opacity: animateIn
|
||||
|
|
Loading…
Reference in a new issue