call hapticfeedback.vibrate on iOS (#1044)
This commit is contained in:
parent
179f300c78
commit
5f8c9439b0
3 changed files with 19 additions and 3 deletions
|
|
@ -1718,7 +1718,11 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
|
||||
// select the message
|
||||
onSelectMessage(pangeaMessageEvent.event);
|
||||
HapticFeedback.mediumImpact();
|
||||
if (!kIsWeb) {
|
||||
Platform.isAndroid
|
||||
? HapticFeedback.mediumImpact()
|
||||
: HapticFeedback.vibrate();
|
||||
}
|
||||
}
|
||||
|
||||
// final List<int> selectedTokenIndicies = [];
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
|
|
@ -8,6 +9,7 @@ import 'package:fluffychat/pangea/matrix_event_wrappers/pangea_message_event.dar
|
|||
import 'package:fluffychat/pangea/widgets/chat/message_selection_overlay.dart';
|
||||
import 'package:fluffychat/pangea/widgets/pressable_button.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
|
|
@ -190,7 +192,11 @@ class DisabledAnimationState extends State<DisabledAnimation>
|
|||
return GestureDetector(
|
||||
onTap: () {
|
||||
_controller.forward().then((_) => _controller.reset());
|
||||
HapticFeedback.mediumImpact();
|
||||
if (!kIsWeb) {
|
||||
Platform.isAndroid
|
||||
? HapticFeedback.mediumImpact()
|
||||
: HapticFeedback.vibrate();
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
width: widget.size,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
|
|
@ -61,7 +63,11 @@ class PressableButtonState extends State<PressableButton>
|
|||
await _animationCompleter!.future;
|
||||
}
|
||||
if (mounted) _controller.reverse();
|
||||
HapticFeedback.mediumImpact();
|
||||
if (!kIsWeb) {
|
||||
Platform.isAndroid
|
||||
? HapticFeedback.mediumImpact()
|
||||
: HapticFeedback.vibrate();
|
||||
}
|
||||
}
|
||||
|
||||
void _onTapCancel() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue