【发布时间】:2020-11-23 09:13:00
【问题描述】:
我的设计显示了 Flash 报价计数,但是当我尝试如下图进行设计时,小部件的对齐方式无法正常工作。我如何处理这个设计?我尝试了很多代码,但都没有得到想要的结果。
我正在尝试创建的设计
到目前为止我所做的设计
代码
Widget FlashOffers(){
return GestureDetector(
onTap: (){
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FlashOfferListScreen(),
),
);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Stack(
children: [
Container(
height: 50,
width:350,
decoration: new BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.all(Radius.circular(15))
),
),
Center(child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text("Flash Offers",style: TextStyle(fontSize: 18,color: Colors.white,fontWeight: FontWeight.bold),),
)),
Row(
// crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Stack(
children: [
SvgPicture.asset("assets/images/YELLOW.svg"),
Text("3")
],
),
],),
],
),
),
);
}
【问题讨论】:
-
不用栈也可以实现
-
你能帮我写代码吗@FaiiziiAwan
标签: flutter dart flutter-layout