haptic_morse library
Convert text to Morse code and to haptic vibration sequences.
This library is pure Dart - it does not import Flutter - so it runs in a
CLI, on a server, and in dart test. To drive the device motor, import
package:haptic_morse/haptic_morse_vibration.dart as well.
import 'package:haptic_morse/haptic_morse.dart';
void main() {
print('SOS'.toMorseString()); // ... --- ...
print('SOS'.toVibrationPattern()); // [0, 100, 100, 100, ...]
}
Classes
- HapticDash
-
A long vibration - the
-of Morse code. - HapticDot
-
A short vibration - the
.of Morse code. - HapticEvent
- A single element of a haptic Morse sequence.
- HapticLetterGap
- The silence between two letters of the same word.
- HapticModel
- The result of converting text to Morse code: the original text, its dot and dash representation, and the haptic sequence that plays it.
- HapticMorse
- Converts text to Morse code and to haptic sequences, and back again.
- HapticSymbolGap
- The silence between two symbols of the same letter.
- HapticWordGap
- The silence between two words.
Extensions
-
HapticEventPattern
on List<
HapticEvent> - Conversion helpers for a sequence of HapticEvents.
- StringMorseExtension on String
- Morse conversions directly on String.