aagarwal1012 / Animated-Text-Kit

🔔 A flutter package to create cool and beautiful text animations. [Flutter Favorite Package]
https://animated-text-kit.web.app
MIT License
1.66k stars 304 forks source link

textStyle property is no longer required for AnimatedText subclasses. #217

Closed awhitford closed 3 years ago

awhitford commented 3 years ago
codecov[bot] commented 3 years ago

Codecov Report

Merging #217 (a07301e) into master (8691b17) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #217   +/-   ##
=======================================
  Coverage   95.09%   95.09%           
=======================================
  Files           9        9           
  Lines         428      428           
=======================================
  Hits          407      407           
  Misses         21       21           
Impacted Files Coverage Δ
lib/src/typer.dart 100.00% <ø> (ø)
lib/src/animated_text.dart 76.25% <100.00%> (ø)
lib/src/colorize.dart 95.23% <100.00%> (+0.23%) :arrow_up:
lib/src/fade.dart 100.00% <100.00%> (ø)
lib/src/rotate.dart 100.00% <100.00%> (ø)
lib/src/scale.dart 100.00% <100.00%> (ø)
lib/src/typewriter.dart 100.00% <100.00%> (ø)
lib/src/wavy.dart 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8691b17...a07301e. Read the comment docs.

awhitford commented 3 years ago

ColorizeAnimatedText was the one exception -- it needs to know the textStyle.fontSize in order to calculate the tuning:

    // Note: This calculation is the only reason why [textStyle] is required
    final tuning = (300.0 * colors.length) *
        (textStyle!.fontSize! / 24.0) *
        0.75 *
        (textCharacters.length / 15.0);

If there is an alternate strategy to calculating tuning (during initAnimation), then perhaps we could drop the textStyle requirement.