import 'package:shimmer/shimmer.dart'; import 'package:flutter/material.dart'; /// /// 公告的骨架屏 /// class CustomNoticeSkeleton extends StatelessWidget { final Map map; const CustomNoticeSkeleton({this.map}); @override Widget build(BuildContext context) { return Container(padding: const EdgeInsets.symmetric(horizontal: 12.5), child: _shimmerWidget(width: double.infinity, height: 30, radius: 8)); } Widget _shimmerWidget({double width, double height, double radius = 0}) { return Shimmer.fromColors( baseColor: Colors.grey[300], highlightColor: Colors.grey[100], child: Container( width: width, height: height, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(radius)), ), ); } }