import 'package:flutter/material.dart'; import 'package:shimmer/shimmer.dart'; class HotRankingSkeleton extends StatelessWidget { @override Widget build(BuildContext context) { return Shimmer.fromColors( baseColor: Colors.grey[300], highlightColor: Colors.grey[100], child: Column( children: [ Container( width: double.infinity, margin: EdgeInsets.all(16), height: 48, child: Row( children: _buildTopRow(), )), Expanded( child: Container( child: Column( children: _buildBottomListItem(), ), )) ], ), ); } _buildBottomListItem() { List listWidget = List(); for (var index = 0; index < 3; index++) { listWidget.add(Container( margin: EdgeInsets.only(left: 16,top: 10,bottom: 10), child: Row( children: [ Container( width: 127, height: 127, color: Colors.white, ), Container( height: 127, margin: EdgeInsets.only(left: 10), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( height: 40, width: 200, color: Colors.white, ), Container( height: 30, width: 100, color: Colors.grey, ), Container( height: 30, width: 200, color: Colors.grey, ) ], ), ) ], ), )); } return listWidget; } _buildTopRow() { List listWidget = List(); for (var index = 0; index < 5; index++) { listWidget.add(Container( width: 50, color: Colors.white, margin: EdgeInsets.all(10), )); } return listWidget; } }