gpt4 book ai didi

Flutter 去除边框扩展磁贴

转载 作者:行者123 更新时间:2023-12-04 11:37:10 24 4
gpt4 key购买 nike

我创建了一个扩展图块,但找不到如何删除框的边框或阴影的方法。你们知道命令吗?
这是一张图片
https://gyazo.com/6dc133ca91071c0afeb65899688311aa
这是一张图片,你可以在角落边缘看到它
对不起,因为它很长,但这是完整的扩展

ExpansionTile(
trailing: Text(''),
leading: Container(
margin: new EdgeInsets.only(left: 0, top: 10.0, right: 0.0, bottom: 0.0),
child: Image.asset(
'images/food.png'
)),
title: Row(
children: < Widget > [


Padding(
padding: const EdgeInsets.only(right: 0, left: 10, top: 15, bottom: 15),
child: Column(textDirection: TextDirection.ltr, crossAxisAlignment: CrossAxisAlignment.start, children: < Widget > [



Container(
margin: new EdgeInsets.only(left: 0.0, top: 7.0, right: 0.0, bottom: 3.0),
child: Text(
'Food System', textAlign: TextAlign.left,
style: TextStyle(
color: Colors.white,
fontSize: 25,
),
)),
Text(
'Customize the food system', textAlign: TextAlign.left,
style: TextStyle(

color: Colors.white,
fontSize: 15,
),
)

])),

], ),
children: < Widget > [



Container(
width: 300,
margin: new EdgeInsets.only(left: 10.0, top: 0.0, right: 10.0, bottom: 10.0),
color: Colors.transparent,
child: new Container(


padding: new EdgeInsets.all(20),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: < Widget > [
Container(
margin: new EdgeInsets.only(left: 15.0, top: .0, right: 20.0, bottom: 5.0),
child: Text('Storage', style: TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold)), ),
Center(child: Column(children: < Widget > [
Container(
child: Column(children: < Widget > [
Text('2.4 KG left - 7 Days', style: TextStyle(color: Colors.white, fontSize: 20)),
Text('200 G / Meal - 600 G / Day', style: TextStyle(color: Colors.white, fontSize: 20)),
], ),
margin: new EdgeInsets.only(left: 0, top: 0, right: 0, bottom: 10.0),
)

], )),
Container(
margin: new EdgeInsets.only(left: 18.0, top: .0, right: 20.0, bottom: 5.0),
child: Text('Meal times', style: TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold)), ),
Center(child: Column(children: < Widget > [

Text('1. Breakfast - 8:30 AM', style: TextStyle(color: Colors.white, fontSize: 20)),
Text('2. Lunch - 2:00 PM', style: TextStyle(color: Colors.white, fontSize: 20)),
Text('3. Dinner - 9:15 PM', style: TextStyle(color: Colors.white, fontSize: 20)),
], ))
], ), )
),




Container(
height: 50.0,
width: 300,

margin: new EdgeInsets.only(left: 10.0, top: 10.0, right: 10.0, bottom: 10.0),
color: Colors.transparent,
child: new Container(
decoration: new BoxDecoration(
color: Colors.blue,
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [Color(0xff37b9ff), Color(0xff5d3afd)]),
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(40.0),
topRight: const Radius.circular(40.0),
bottomLeft: const Radius.circular(40.0),
bottomRight: const Radius.circular(40.0),

)
),
child: Center(child:

Text('Edit', style: TextStyle(color: Colors.white, fontSize: 15))

, )
)
),
])

最佳答案

您可以将其包装在 Theme 小部件中,然后执行以下操作:

Theme(
data: ThemeData().copyWith(dividerColor: Colors.transparent),
child: ExpansionTile(
或者如果您使用自定义 主题设置 ,您可以使用 Theme.of(context)而不是 ThemeData()像这样:
Theme(
data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
child: ExpansionTile(

关于Flutter 去除边框扩展磁贴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64123839/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com