|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- 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: <Widget>[
- Container(
- width: double.infinity,
- margin: EdgeInsets.all(16),
- height: 48,
- child: Row(
- children: _buildTopRow(),
- )),
- Expanded(
- child: Container(
- child: Column(
- children: _buildBottomListItem(),
- ),
- ))
- ],
- ),
- );
- }
-
- _buildBottomListItem() {
- List<Widget> listWidget = List();
- for (var index = 0; index < 3; index++) {
- listWidget.add(Container(
- margin: EdgeInsets.only(left: 16,top: 10,bottom: 10),
- child: Row(
- children: <Widget>[
- 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: <Widget>[
- 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<Widget> listWidget = List();
- for (var index = 0; index < 5; index++) {
- listWidget.add(Container(
- width: 50,
- color: Colors.white,
- margin: EdgeInsets.all(10),
- ));
- }
- return listWidget;
- }
- }
|