From c6121d7754cbd77af89e885b53c17fbbe4672ce6 Mon Sep 17 00:00:00 2001 From: Sicherhaven Date: Sat, 4 Apr 2026 17:38:39 +0530 Subject: [PATCH] =?UTF-8?q?feat:=20REV-003=20=E2=80=94=20stagger=20slide/f?= =?UTF-8?q?ade=20animations=20on=20review=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reviews/widgets/review_section.dart | 28 +++++++++++++------ pubspec.lock | 8 ++++++ pubspec.yaml | 1 + 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/lib/features/reviews/widgets/review_section.dart b/lib/features/reviews/widgets/review_section.dart index 9fc35d2..32d93d0 100644 --- a/lib/features/reviews/widgets/review_section.dart +++ b/lib/features/reviews/widgets/review_section.dart @@ -1,5 +1,6 @@ // lib/features/reviews/widgets/review_section.dart import 'package:flutter/material.dart'; +import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import '../../../core/storage/token_storage.dart'; import '../../../core/utils/error_utils.dart'; import '../models/review_models.dart'; @@ -162,15 +163,26 @@ class _ReviewSectionState extends State { ) else ...[ const SizedBox(height: 12), - ...List.generate(_reviews.length, (i) => Padding( - padding: const EdgeInsets.only(bottom: 12), - child: ReviewCard( - review: _reviews[i], - currentUsername: _currentUsername, - onHelpful: _handleHelpful, - onFlag: _handleFlag, + AnimationLimiter( + child: Column( + children: AnimationConfiguration.toStaggeredList( + duration: const Duration(milliseconds: 375), + childAnimationBuilder: (widget) => SlideAnimation( + verticalOffset: 50.0, + child: FadeInAnimation(child: widget), + ), + children: List.generate(_reviews.length, (i) => Padding( + padding: const EdgeInsets.only(bottom: 12), + child: ReviewCard( + review: _reviews[i], + currentUsername: _currentUsername, + onHelpful: _handleHelpful, + onFlag: _handleFlag, + ), + )), + ), ), - )), + ), ], // Load more diff --git a/pubspec.lock b/pubspec.lock index ce93622..b2e9e15 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -246,6 +246,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.30" + flutter_staggered_animations: + dependency: "direct main" + description: + name: flutter_staggered_animations + sha256: "81d3c816c9bb0dca9e8a5d5454610e21ffb068aedb2bde49d2f8d04f75538351" + url: "https://pub.dev" + source: hosted + version: "1.1.1" flutter_svg: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 99cbfd7..5de04e6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,6 +27,7 @@ dependencies: google_sign_in: ^6.2.2 http: ^1.2.0 shimmer: ^3.0.0 + flutter_staggered_animations: ^1.1.1 dev_dependencies: flutter_test: