list_animation_layout.dart 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import 'package:flutter/material.dart';
  2. import 'package:shimmer/shimmer.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. class ListAnimationLayout extends StatelessWidget {
  5. const ListAnimationLayout({super.key});
  6. @override
  7. Widget build(BuildContext context) {
  8. return ListView.builder(
  9. itemCount: 20,
  10. physics: const AlwaysScrollableScrollPhysics(),
  11. padding: EdgeInsets.symmetric(
  12. horizontal: 16.sp, vertical: 16.sp),
  13. itemBuilder: (_, __) {
  14. return Shimmer.fromColors(
  15. baseColor: Color(0xffe5e5e5),
  16. highlightColor: Color(0xfff5f5f5),
  17. child: const AnimationItem(),
  18. );
  19. },
  20. );
  21. }
  22. }
  23. class AnimationItem extends StatelessWidget {
  24. const AnimationItem({super.key});
  25. @override
  26. Widget build(BuildContext context) {
  27. return Container(
  28. width: double.infinity,
  29. height: 60.0.h,
  30. decoration: BoxDecoration(
  31. border: Border(
  32. bottom: Divider.createBorderSide(context, width: 1.sp),
  33. ),
  34. ),
  35. child: Row(
  36. children: [
  37. Container(height: 50.0.h, width: 50.0.w, color: Color(0xffe5e5e5)),
  38. SizedBox(width: 16.sp),
  39. Expanded(
  40. child: Column(
  41. mainAxisAlignment: MainAxisAlignment.spaceAround,
  42. crossAxisAlignment: CrossAxisAlignment.start,
  43. children: [
  44. Container(
  45. height: 13.0.h,
  46. width: double.infinity,
  47. color: Color(0xffe5e5e5)),
  48. Container(
  49. height: 13.0.h,
  50. width: double.infinity,
  51. color: Color(0xffe5e5e5)),
  52. Container(
  53. height: 10.0.h, width: 200.0.w, color: Color(0xffe5e5e5)),
  54. ],
  55. ))
  56. ],
  57. ),
  58. );
  59. }
  60. }