vibrateText method

Future<void> vibrateText(
  1. String text, {
  2. HapticMorse morse = const HapticMorse(),
  3. int amplitude = -1,
  4. double sharpness = 0.5,
})

Converts text to Morse and plays it.

Pass morse to override the timings or alphabet. Returns without touching the motor when text contains nothing encodable.

amplitude is the motor strength from 1 to 255 where supported, or -1 for the device default. sharpness is iOS only.

Implementation

Future<void> vibrateText(
  String text, {
  HapticMorse morse = const HapticMorse(),
  int amplitude = -1,
  double sharpness = 0.5,
}) =>
    vibrateEvents(
      morse.convertTextToHapticEvents(text),
      amplitude: amplitude,
      sharpness: sharpness,
    );