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.64k stars 304 forks source link

New Animation like Moving Letters Effect 15 #207

Open awhitford opened 3 years ago

awhitford commented 3 years ago

@saurabhraj042 requested to add a new animated text like Effect 15

saurabhraj042 commented 3 years ago

@awhitford thanks for opening this issue , please assign it to me .

saurabhraj042 commented 3 years ago

@awhitford I have a doubt like in the sample Effect 15 we have two separate Text elements, but in the animated-text kit package most of the animations work with single string at a time and I have been able to recreate Effect 15 for only one String at a time so I just want to confirm if that's we are planning to do .

awhitford commented 3 years ago

Focus on the effect for 1 text element. What you are really animating is the zoom in effect.

You can consider that Effect 15 is actually TWO animated texts positioned side by side with a delay.

SirusCodes commented 3 years ago

@saurabhraj042 You can implement it with CustomPainter https://github.com/aagarwal1012/Animated-Text-Kit/blob/master/lib/src/wavy.dart is implemented using CustomPainter

It requires a lot of mathematical calculations but very customizable

awhitford commented 3 years ago

Uhm... Is a CustomPainter approach really necessary? Isn't this just a reverse Scale Animation? You can likely take the Scale Animation and make some adjustments.

SirusCodes commented 3 years ago

What I'm thinking is that user will pass a List<String> like ["Buy Now", "On Sale"]

The sequence of animation would be like.

  1. Buy scales in
  2. Now scales in
  3. Buy Now fades out
  4. On scales in
  5. and so on...

This would be better with CustomPainter

SirusCodes commented 3 years ago

Oh I realized with CustomPainter user would be able to manage duration of text showing up🤔

awhitford commented 3 years ago

@SirusCodes It would be wise to contain complexity. I also want to avoid baking too much complexity in a specific animation because a compositional approach that could be used for other animations is preferred.

The AnimatedText class is designed to animate one text string. If you want to string multiple texts, you then specify a List<AnimatedText> elements to AnimatedTextKit.

SirusCodes commented 3 years ago

@SirusCodes I would be wise to contain complexity. I also want to avoid baking too much complexity in a specific animation because a compositional approach that could be used for other animations is preferred.

Yaa I also feel that CustomPainter will over complicate the animation.

The AnimatedText class is designed to animate one text string. If you want to string multiple texts, you then specify a List<AnimatedText> elements to AnimatedTextKit.

What are you trying to say? AnimatedTextKit is already taking List<AnimatedText> as parameter🤔

saurabhraj042 commented 3 years ago

@awhitford https://codeshare.io/GqgYqX please review this code snippet, I tried keeping it simple and the animation was close to Effect 15

SirusCodes commented 3 years ago

@saurabhraj042 can you open a PR with gif of that animation?

awhitford commented 3 years ago

What are you trying to say? AnimatedTextKit is already taking List<AnimatedText> as parameter🤔

AnimatedTextKit is a small example of a compositional approach because one can mix and match different AnimatedText subclasses.

To be even more clear...

I hope this helps clarify my earlier comments.

SirusCodes commented 3 years ago

Yes thanks now it's a lot clear 😃

awhitford commented 3 years ago

@awhitford https://codeshare.io/GqgYqX please review this code snippet, I tried keeping it simple and the animation was close to Effect 15

I think this is meeting my expectations. I'd have to see it in action to be sure, but it looks pretty good.

I wonder if we can come up with a better name for the effect than OutNow. It seems more like a "Zoom In" effect to me, but I'm definitely open to ideas here.

Also, I'm advocating that we do not make a corresponding Kit class for each new animation. (We have them for the old animations for backwards compatibility.)

saurabhraj042 commented 3 years ago

@awhitford I will do the changes and make a PR asap !

awhitford commented 3 years ago

In addition to the new animation class...

SirusCodes commented 3 years ago

I wonder if we can come up with a better name for the effect than OutNow. It seems more like a "Zoom In" effect to me, but I'm definitely open to ideas here.

How about ZoomInFadeOut?

Also, I'm advocating that we do not make a corresponding Kit class for each new animation. (We have them for the old animations for backwards compatibility.)

Let's wait for the final words from admin.

saurabhraj042 commented 3 years ago

@awhitford What do you mean by test coverage ?

aagarwal1012 commented 3 years ago

Also, I'm advocating that we do not make a corresponding Kit class for each new animation. (We have them for the old animations for backward compatibility.)

I agree with @awhitford, we don't need any kit class from now on.

ZoomInFadeOut looks fine to me @SirusCodes . 😅