import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/item_title.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class QuickOrder extends StatefulWidget { @override State createState() { return _QuickOrder(); } } class _QuickOrder extends State { @override Widget build(BuildContext context) { return Column( children: [ ItemTitle( text: "快捷下单", imgPath: "assets/image/icon_points_mall.png", ), Container( height: 170, margin: EdgeInsets.only(top: 10), child: ListView.builder( scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), padding: EdgeInsets.symmetric(horizontal: 10), itemBuilder: (context, position) { return storeItem(); }, itemCount: 10, ), ), ], ); } Widget storeItem() { return Container( width: 160, height: 160, margin: EdgeInsets.symmetric( horizontal: 6.w, vertical: 3, ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(4.w), boxShadow: [ BoxShadow( color: Color(0x08000000), offset: Offset(0, 3), blurRadius: 14, spreadRadius: 0, ), ], ), child: Stack( children: [ Positioned( top: 0, left: 0, right: 0, child: ClipRRect( child: Image.asset( "assets/image/share_image_bg.png", width: double.infinity, height: 95, fit: BoxFit.cover, ), borderRadius: BorderRadius.vertical( top: Radius.circular(4), ), ), ), Positioned( bottom: 0, left: 0, right: 0, child: SvgPicture.asset( "assets/svg/kuaijiexiadan_bg.svg", width: double.infinity, height: 95, fit: BoxFit.fill, ), ), Positioned( bottom: 0, left: 0, right: 0, child: Container( height: 95, child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( "assets/image/default_user.png", width: 32, height: 32, ), Text( "百年川椒", style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.medium, color: Colors.black, ), ), Text( "正宗重庆老味道", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.medium, color: Color(0xFF868686), ), ), SizedBox( height: 5, ), ], ), ), ), ], ), ); } }