import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class HomeQuickEntrySkeleton extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      height: 153,
      child: GridView.builder(
        physics: NeverScrollableScrollPhysics(),
        gridDelegate:
            SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 5),
        itemBuilder: (context, index) {
          return HomeQuickEntrySkeletonItem(
            index: index,
          );
        },
        itemCount: 10,
      ),
    );
  }
}

class HomeQuickEntrySkeletonItem extends StatelessWidget {
  final int index;

  const HomeQuickEntrySkeletonItem({this.index});

  @override
  Widget build(BuildContext context) {
    return Container(
        alignment: Alignment.center,
        child: Shimmer.fromColors(
          baseColor: Colors.grey[300],
          highlightColor: Colors.grey[100],
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              // 图片
              Container(
                decoration: BoxDecoration(
                    color: Colors.white,
                  borderRadius: BorderRadius.circular(40.h)
                ),
                height: 80.h,
                width: 80.h,

              ),
              SizedBox(height: 10.h),

//              Container(height: 10.h, width: 40.w, color: Colors.white,),
            ],
          ),
        ));
  }
}
