You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fluffychat/lib/pangea/analytics_misc/text_loading_shimmer.dart

30 lines
842 B
Dart

import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
import 'package:fluffychat/config/app_config.dart';
class TextLoadingShimmer extends StatelessWidget {
final double width;
const TextLoadingShimmer({
super.key,
this.width = 140.0,
});
@override
Widget build(BuildContext context) {
return Shimmer.fromColors(
baseColor: Colors.transparent, // Base color of the shimmer effect
// for higlight, use white with 50 opacity
highlightColor: Theme.of(context).colorScheme.primary.withAlpha(70),
child: Container(
height: AppConfig.messageFontSize * AppConfig.fontSizeFactor,
width: width, // Width of the rectangle
color: Theme.of(context)
.colorScheme
.primary, // Background color of the rectangle
),
);
}
}