This commit is contained in:
xh 2024-07-16 16:07:11 +08:00
parent fec55c2366
commit 6173c196a5

View File

@ -16,85 +16,85 @@ class DrawerView extends StatelessWidget {
width: 320.w, width: 320.w,
backgroundColor: Colors.black, backgroundColor: Colors.black,
child: Container( child: Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage(Assets.imagesHomeBackground), image: AssetImage(Assets.imagesHomeBackground),
fit: BoxFit.cover, fit: BoxFit.cover,
),
), ),
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: <Widget>[
height: MediaQuery.of(context).padding.top + 15.w, SizedBox(height: MediaQuery.of(context).padding.top + 15.w),
Container(
margin: EdgeInsets.only(left: 16.w),
child: Text(
"Style classification",
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.w600,
color: Colors.white),
), ),
Container( ),
margin: EdgeInsets.only(left: 16.w), 10.verticalSpace,
child: Text( Expanded(
"Style classification", child: MasonryGridView.count(
style: TextStyle( itemCount: controller.categoryList.length,
fontSize: 24.sp, crossAxisCount: 2,
fontWeight: FontWeight.w600, mainAxisSpacing: 10.w,
color: Colors.white), crossAxisSpacing: 10.w,
)), padding: EdgeInsets.fromLTRB(
10.verticalSpace, 8,
Expanded( 0,
child: MasonryGridView.count( 8,
itemCount: controller.categoryList.length, MediaQuery.of(context).padding.bottom + 10,
crossAxisCount: 2, ).w,
mainAxisSpacing: 10.w, itemBuilder: (context, index) {
crossAxisSpacing: 10.w, return GestureDetector(
padding: EdgeInsets.fromLTRB( onTap: () => controller
8, .onTapToCategory(controller.categoryList[index]),
0, child: Stack(
8, alignment: AlignmentDirectional.bottomStart,
MediaQuery.of(context).padding.bottom + 10, children: [
).w, Container(
itemBuilder: (context, index) { clipBehavior: Clip.hardEdge,
return GestureDetector( decoration: BoxDecoration(
onTap: () => controller borderRadius: BorderRadius.circular(12.w),
.onTapToCategory(controller.categoryList[index]), ),
child: Stack( child: Image.asset(
alignment: AlignmentDirectional.bottomStart, controller.categoryImgList[index],
children: [ ),
Container( ),
clipBehavior: Clip.hardEdge, Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.w), borderRadius: BorderRadius.circular(12.w),
), color: Colors.black54,
child: Image.asset( ),
controller.categoryImgList[index], padding: const EdgeInsets.symmetric(
horizontal: 9,
).w,
margin: const EdgeInsets.symmetric(
vertical: 9,
horizontal: 9,
).w,
child: Text(
controller.categoryList[index],
style: TextStyle(
fontSize: 14.sp,
color: Colors.white,
fontWeight: FontWeight.w600,
), ),
), ),
Container( ),
decoration: BoxDecoration( ],
borderRadius: BorderRadius.circular(12.w), ),
color: Colors.black54, );
), },
padding: const EdgeInsets.symmetric(
horizontal: 9,
).w,
margin: const EdgeInsets.symmetric(
vertical: 9,
horizontal: 9,
).w,
child: Text(
controller.categoryList[index],
style: TextStyle(
fontSize: 14.sp,
color: Colors.white,
fontWeight: FontWeight.w600,
),
),
),
],
),
);
},
),
), ),
], ),
)), ],
),
),
); );
} }
} }