shimmer placeholder component

This commit is contained in:
MohammadTaha Basiri 2022-01-05 16:28:44 +03:30
parent fcfe882d40
commit 1e4ae8e5db
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
import 'package:didvan/config/design_config.dart';
import 'package:didvan/config/theme_data.dart';
import 'package:flutter/material.dart';
import 'package:skeleton_text/skeleton_text.dart';
class ShimmerPlaceholder extends StatelessWidget {
final double? height;
final double? width;
final BorderRadius borderRadius;
const ShimmerPlaceholder({
Key? key,
this.height,
this.width,
this.borderRadius = DesignConfig.lowBorderRadius,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return SkeletonAnimation(
borderRadius: borderRadius,
shimmerColor: Theme.of(context).colorScheme.secondCTA,
gradientColor: Theme.of(context).colorScheme.cardBorder,
child: Container(
height: height,
width: width,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.disabledBackground,
borderRadius: borderRadius,
),
),
);
}
}