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.
aku_new_community/lib/widget/goods_card_skeleton.dart

98 lines
3.5 KiB

import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
import 'package:akuCommunity/utils/screenutil.dart';
class GoodsCardSkeleton extends StatelessWidget {
const GoodsCardSkeleton({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
child: GridView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: 6,
itemBuilder: (BuildContext context, int index) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
),
child: Shimmer.fromColors(
baseColor: Colors.grey[300],
highlightColor: Colors.grey[100],
enabled: true,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.withOpacity(0.2),
offset: Offset(1.1, 1.1),
blurRadius: 10.0),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
color: Colors.white,
4 years ago
width: 333.w,
height: 344.w,
),
Padding(
padding: EdgeInsets.only(
4 years ago
left: 12.w,
right: 12.w,
top: 22.w,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
),
margin:
4 years ago
EdgeInsets.only(bottom: 6.w),
height: 30.w,
width: double.infinity,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
),
margin:
4 years ago
EdgeInsets.only(bottom: 20.w),
height: 30.w,
width: double.infinity,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
),
4 years ago
height: 32.w,
width: 61.w,
),
],
),
),
],
),
),
),
);
},
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
4 years ago
mainAxisSpacing: 20.w,
crossAxisSpacing: 20.w,
childAspectRatio: 333.w / 509.w),
),
);
}
}