基础组件库
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.
 
 
 
 
 

86 line
2.2 KiB

  1. import 'package:flutter/material.dart';
  2. import 'package:shimmer/shimmer.dart';
  3. class HotRankingSkeleton extends StatelessWidget {
  4. @override
  5. Widget build(BuildContext context) {
  6. return Shimmer.fromColors(
  7. baseColor: Colors.grey[300],
  8. highlightColor: Colors.grey[100],
  9. child: Column(
  10. children: <Widget>[
  11. Container(
  12. width: double.infinity,
  13. margin: EdgeInsets.all(16),
  14. height: 48,
  15. child: Row(
  16. children: _buildTopRow(),
  17. )),
  18. Expanded(
  19. child: Container(
  20. child: Column(
  21. children: _buildBottomListItem(),
  22. ),
  23. ))
  24. ],
  25. ),
  26. );
  27. }
  28. _buildBottomListItem() {
  29. List<Widget> listWidget = List();
  30. for (var index = 0; index < 3; index++) {
  31. listWidget.add(Container(
  32. margin: EdgeInsets.only(left: 16,top: 10,bottom: 10),
  33. child: Row(
  34. children: <Widget>[
  35. Container(
  36. width: 127,
  37. height: 127,
  38. color: Colors.white,
  39. ),
  40. Container(
  41. height: 127,
  42. margin: EdgeInsets.only(left: 10),
  43. child: Column(
  44. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  45. crossAxisAlignment: CrossAxisAlignment.start,
  46. children: <Widget>[
  47. Container(
  48. height: 40,
  49. width: 200,
  50. color: Colors.white,
  51. ),
  52. Container(
  53. height: 30,
  54. width: 100,
  55. color: Colors.grey,
  56. ),
  57. Container(
  58. height: 30,
  59. width: 200,
  60. color: Colors.grey,
  61. )
  62. ],
  63. ),
  64. )
  65. ],
  66. ),
  67. ));
  68. }
  69. return listWidget;
  70. }
  71. _buildTopRow() {
  72. List<Widget> listWidget = List();
  73. for (var index = 0; index < 5; index++) {
  74. listWidget.add(Container(
  75. width: 50,
  76. color: Colors.white,
  77. margin: EdgeInsets.all(10),
  78. ));
  79. }
  80. return listWidget;
  81. }
  82. }