I am using flutter_animate 4.4.0
package in my flutter app.
I am trying to achieve animation on a particular widget like the title of this Screen: Animation gif
I am only trying to achieve the shade that runs in a loop on an image.
What I have done so far is:
Positioned(
left: 93.w,
top: 399.h,
child: Image.asset(
'assets/images/logo.png',
height: 94.h,
width: 224.w,
).animate(
delay: 500.ms,
onPlay: (controller) =>
controller.repeat(period: 500.milliseconds)).tint(
color: Colors.white.withOpacity(0.5),
),
),
I have also tried Shimmer.fromColors()
. However, the baseColor
property changes the color of the image.
I appreciate all of your kind help.
2
Answers
Use this package to achieve that title animation.
You don’t need to use the
shimmer
package sinceflutter_animate
provides that functionally as well, the additional color you are seeing is coming from thetint
extensionHere is a working sample : https://zapp.run/edit/flutter-z43a06n743b0?entry=lib/main.dart&file=lib/main.dart
Code:
Looks like this: