基础组件库
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

37 řádky
828 B

  1. import 'package:shimmer/shimmer.dart';
  2. import 'package:flutter/material.dart';
  3. ///
  4. /// 搜索输入框的骨架图
  5. ///
  6. class SearchInputSkeleton extends StatelessWidget {
  7. @override
  8. Widget build(BuildContext context) {
  9. return Container(
  10. width: double.infinity,
  11. margin: const EdgeInsets.only(right: 12.5, left: 12.5, top: 13),
  12. child: _shimmerWidget(
  13. width: double.infinity,
  14. height: 32,
  15. ),
  16. );
  17. }
  18. Widget _shimmerWidget({double width, double height, double radius = 0}) {
  19. return Shimmer.fromColors(
  20. baseColor: Colors.grey[300],
  21. highlightColor: Colors.grey[100],
  22. child: Container(
  23. width: width,
  24. height: height,
  25. decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(radius)),
  26. ),
  27. );
  28. }
  29. }