| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- import 'package:flutter/material.dart';
- import 'package:shimmer/shimmer.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- class ListAnimationLayout extends StatelessWidget {
- const ListAnimationLayout({super.key});
- @override
- Widget build(BuildContext context) {
- return ListView.builder(
- itemCount: 20,
- physics: const AlwaysScrollableScrollPhysics(),
- padding: EdgeInsets.symmetric(
- horizontal: 16.sp, vertical: 16.sp),
- itemBuilder: (_, __) {
- return Shimmer.fromColors(
- baseColor: Color(0xffe5e5e5),
- highlightColor: Color(0xfff5f5f5),
- child: const AnimationItem(),
- );
- },
- );
- }
- }
- class AnimationItem extends StatelessWidget {
- const AnimationItem({super.key});
- @override
- Widget build(BuildContext context) {
- return Container(
- width: double.infinity,
- height: 60.0.h,
- decoration: BoxDecoration(
- border: Border(
- bottom: Divider.createBorderSide(context, width: 1.sp),
- ),
- ),
- child: Row(
- children: [
- Container(height: 50.0.h, width: 50.0.w, color: Color(0xffe5e5e5)),
- SizedBox(width: 16.sp),
- Expanded(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.spaceAround,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- height: 13.0.h,
- width: double.infinity,
- color: Color(0xffe5e5e5)),
- Container(
- height: 13.0.h,
- width: double.infinity,
- color: Color(0xffe5e5e5)),
- Container(
- height: 10.0.h, width: 200.0.w, color: Color(0xffe5e5e5)),
- ],
- ))
- ],
- ),
- );
- }
- }
|