hnvn / flutter_shimmer

A package provides an easy way to add shimmer effect in Flutter project
BSD 3-Clause "New" or "Revised" License
1.8k stars 204 forks source link

Delay between shimmers #30

Open joj3000 opened 4 years ago

joj3000 commented 4 years ago

Hi, I've tried a bunch of different stuff in a lot of places and i can't figure out how to set a delay between two shimmer animations, instead of the animation to starts over once it's finished. Any idea how to achieve this ?

Thanks a lot for your help, and for your awesome package !

theweiweiway commented 4 years ago

Definitely very interested in this feature as well

fadhlisulaimi commented 4 years ago

You just have to use period function cleverly.

//assuming you are generating a listview of shimmer records as placeholder //each record has an index

Shimmer.fromColors(,
                period: Duration(milliseconds: 800 + (index * 100)),
                child: ...
              );
Near0ne commented 4 years ago

Hello, i'm interested in this feature too, in my case, i want to loop the shammer animation to make my component shines every x seconds Do you think we could get it ? Thanks in advance !

jinyus commented 3 years ago

I submitted a pull request #41 with this feature. You can use my fork in the meantime, in case it's not merged soon.

shimmer:
  git: 
     url: https://github.com/jinyus/flutter_shimmer
Kerandon commented 1 year ago

I just used this and it worked great. Wonder why this feature is not yet in the pub.dev package?