parent
a1715ffc17
commit
23e9551f51
@ -0,0 +1,92 @@
|
||||
import 'package:aku_community/base/base_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:aku_community/utils/headers.dart';
|
||||
|
||||
class GoodsCard extends StatelessWidget {
|
||||
const GoodsCard({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialButton(
|
||||
color: Colors.white,
|
||||
elevation: 0,
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: () {},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Stack(
|
||||
children: [
|
||||
Image.asset(
|
||||
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
height: 38.w,
|
||||
color: Colors.black54,
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Text(
|
||||
'分别是紫色烦恼则妇女色泽封闭周四鹅u部分紫色部分',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.w,
|
||||
vertical: 20.w,
|
||||
),
|
||||
child: Text(
|
||||
'袁隆平水稻大米精选 56kg唇齿流香 无常有机稻花 无常有机稻花',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.w,
|
||||
),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '¥123.45 ',
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
fontSize: 28.sp,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: '123已付款',
|
||||
style: TextStyle(
|
||||
color: ktextSubColor,
|
||||
fontSize: 20.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
16.hb,
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
import 'package:aku_community/ui/market/goods/goods_card.dart';
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:aku_community/utils/headers.dart';
|
||||
import 'package:waterfall_flow/waterfall_flow.dart';
|
||||
|
||||
class GoodsListView extends StatefulWidget {
|
||||
GoodsListView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_GoodsListViewState createState() => _GoodsListViewState();
|
||||
}
|
||||
|
||||
class _GoodsListViewState extends State<GoodsListView> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: 'TEST',
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(CupertinoIcons.search),
|
||||
onPressed: () {},
|
||||
)
|
||||
],
|
||||
appBarBottom: PreferredSize(
|
||||
child: SizedBox(
|
||||
height: 220.w,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 18.w),
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: [
|
||||
GoodsSubTypeButton(),
|
||||
],
|
||||
),
|
||||
),
|
||||
preferredSize: Size.fromHeight(220.w),
|
||||
),
|
||||
body: WaterfallFlow(
|
||||
padding: EdgeInsets.all(32.w),
|
||||
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 20.w,
|
||||
crossAxisSpacing: 20.w,
|
||||
),
|
||||
children: [
|
||||
GoodsCard(),
|
||||
GoodsCard(),
|
||||
GoodsCard(),
|
||||
GoodsCard(),
|
||||
GoodsCard(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GoodsSubTypeButton extends StatelessWidget {
|
||||
const GoodsSubTypeButton({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialButton(
|
||||
minWidth: 136.w,
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: () {},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
width: 100.w,
|
||||
height: 100.w,
|
||||
),
|
||||
20.hb,
|
||||
Text(
|
||||
'健康运动',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue