warningNotification static method

Future<void> warningNotification()

Provides a haptic feedback indicating that a task or action has produced a warning.

On iOS, this uses a UINotificationFeedbackGenerator with UINotificationFeedbackTypeWarning.

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

See also:

Implementation

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