shimmer placeholder component
This commit is contained in:
parent
fcfe882d40
commit
1e4ae8e5db
|
|
@ -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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue