30 lines
823 B
Dart
30 lines
823 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:shimmer/shimmer.dart';
|
|
|
|
class LoadingList extends StatelessWidget {
|
|
final int count;
|
|
final double itemHeight;
|
|
|
|
const LoadingList({super.key, this.count = 5, this.itemHeight = 100});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Shimmer.fromColors(
|
|
baseColor: const Color(0xFFE5E7EB),
|
|
highlightColor: const Color(0xFFF9FAFB),
|
|
child: ListView.separated(
|
|
padding: const EdgeInsets.all(16),
|
|
itemCount: count,
|
|
separatorBuilder: (_, _) => const SizedBox(height: 12),
|
|
itemBuilder: (_, _) => Container(
|
|
height: itemHeight,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|