TextTransformationAnimation constructor

TextTransformationAnimation({
  1. required String text,
  2. required Duration duration,
  3. TextStyle? style,
  4. TextOverflow? overflow,
  5. TextAlign? textAlign,
  6. String alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#\$%^&*()_+-={}[]:\";',./<>?`~|\\",
  7. Key? key,
})

Implementation

TextTransformationAnimation(
    { required this.text,
     required this.duration,
    this.style,
    this.overflow,
    this.textAlign,
    String alphabet =
        "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#\$%^&*()_+-={}[]:\";',./<>?`~|\\",
    Key? key})
    : this._alphabetToPosition = Map<String, int>(),
      this._positionToAlphabet = Map<int, String>(),
      super(key: key, duration: duration) {
  for (int i = 0; i < alphabet.length; i++) {
    if (_alphabetToPosition.containsKey(alphabet[i])) {
      throw new FormatException(
          "Alphabet must contain a unique set of characters");
    }
    _positionToAlphabet.putIfAbsent(i, () => alphabet[i]);
    _alphabetToPosition.putIfAbsent(alphabet[i], () => i);
  }
}