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: