56 lines
1.2 KiB
Dart
56 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:shimmer/shimmer.dart';
|
|
|
|
class ShimmerBox extends StatelessWidget {
|
|
final double width;
|
|
final double height;
|
|
final double borderRadius;
|
|
|
|
const ShimmerBox({
|
|
super.key,
|
|
this.width = double.infinity,
|
|
required this.height,
|
|
this.borderRadius = 8,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Shimmer.fromColors(
|
|
baseColor: const Color(0xFFF1F5F9),
|
|
highlightColor: const Color(0xFFFFFFFF),
|
|
loop: 0,
|
|
child: Container(
|
|
width: width,
|
|
height: height,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(borderRadius),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class ShimmerCircle extends StatelessWidget {
|
|
final double size;
|
|
|
|
const ShimmerCircle({super.key, this.size = 48});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Shimmer.fromColors(
|
|
baseColor: const Color(0xFFF1F5F9),
|
|
highlightColor: const Color(0xFFFFFFFF),
|
|
loop: 0,
|
|
child: Container(
|
|
width: size,
|
|
height: size,
|
|
decoration: const BoxDecoration(
|
|
color: Colors.white,
|
|
shape: BoxShape.circle,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|