Search code examples
flutterflutter-animation

How to implement this animation on a widget in flutter


I want to implement this animation on a custom made tile. So how can we implement this slide animation to highlight a widget. enter image description here

So give your suggestion to make it possible


Solution

  • I've another best and short solution. Firstly Add these packages in pubspec.yml- flutter_animate: ^4.2.0+1 shimmer: ^3.0.0

    Container(
                    decoration: const BoxDecoration(
                      border: Border(
                        bottom: BorderSide(
                          color: Colors.black,
                          width: 2,),
                      ),
                    ),
                    child: CustomSettingListTile(
                      prefixIcon: Icons.currency_rupee,
                      labelText: "Subscription Plus",
                      trailingWidget: const Icon(
                        Icons.arrow_forward_ios,
                        size: 20,
                        color: Colors.white,
                      ),
                      onTap: () {
                        // Get.to(() => const FeedbackScreen());
                      },
                    ),
                  )
                .animate(
                    onPlay:(controller) => controller.repeat(),
                  )
                  .shimmer(
                    angle: 0,
                    duration: const Duration(seconds: 2),
                    color: Colors.orange.shade600
                  )