基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

custom_notice_sk.dart 820 B

12345678910111213141516171819202122232425262728
  1. import 'package:shimmer/shimmer.dart';
  2. import 'package:flutter/material.dart';
  3. ///
  4. /// 公告的骨架屏
  5. ///
  6. class CustomNoticeSkeleton extends StatelessWidget {
  7. final Map<String, dynamic> map;
  8. const CustomNoticeSkeleton({this.map});
  9. @override
  10. Widget build(BuildContext context) {
  11. return Container(padding: const EdgeInsets.symmetric(horizontal: 12.5), child: _shimmerWidget(width: double.infinity, height: 30, radius: 8));
  12. }
  13. Widget _shimmerWidget({double width, double height, double radius = 0}) {
  14. return Shimmer.fromColors(
  15. baseColor: Colors.grey[300],
  16. highlightColor: Colors.grey[100],
  17. child: Container(
  18. width: width,
  19. height: height,
  20. decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(radius)),
  21. ),
  22. );
  23. }
  24. }