errorNotification static method

Future<void> errorNotification()

Provides a haptic feedback indicating that a task or action has failed.

On iOS, this uses a UINotificationFeedbackGenerator with UINotificationFeedbackTypeError.

On Android, this uses HapticFeedbackConstants.REJECT on API levels 30 and above. This call has no effects on Android API levels below 30.

See also:

Implementation

static Future<void> errorNotification() async {
  await SystemChannels.platform.invokeMethod<void>(
    'HapticFeedback.vibrate',
    'HapticFeedbackType.errorNotification',
  );
}