Rumahjo-Android-APP/lib/Ui/screens/widgets/shimmerLoadingContainer.dart

33 lines
948 B
Dart
Raw Normal View History

2024-09-07 00:58:50 +00:00
// ignore_for_file: file_names
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
import '../../Theme/theme.dart';
class CustomShimmer extends StatelessWidget {
final double? height;
final double? width;
final double? borderRadius;
final EdgeInsetsGeometry? margin;
const CustomShimmer(
{Key? key, this.height, this.width, this.borderRadius, this.margin})
: super(key: key);
@override
Widget build(BuildContext context) {
return Shimmer.fromColors(
baseColor: Theme.of(context).colorScheme.shimmerBaseColor,
highlightColor: Theme.of(context).colorScheme.shimmerHighlightColor,
child: Container(
width: width,
margin: margin,
height: height ?? 10,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.shimmerContentColor,
borderRadius: BorderRadius.circular(borderRadius ?? 10)),
),
);
}
}