Flutter 移除边框扩展磁贴 [英] Flutter remove border expansion tile

查看:15
本文介绍了Flutter 移除边框扩展磁贴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个扩展图块,但我找不到删除框的边框或阴影的方法.你们知道命令吗?

这是一张照片

点击此处的目标图标

在资源管理器中右击显示

那你应该

  1. 更改文件名并将其复制到您的库中.
  2. 修复导入
  3. 更改类名(非常重要)(通过右键单击和重构)
  4. 终于用上了!!:)

i created an expansion tile and i cannot find a way how to remove the border or shadow of the box. Do you guys know the command?

here is a picture

https://gyazo.com/6dc133ca91071c0afeb65899688311aa

here is a picture, you can see it on the corner edge sorry because it is long but this is the full expansion

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))

                , )
        )
    ),
])

解决方案

this Color comes From Your App Theme and dividerColor ... now You can add this Code in Your Theme

theme: ThemeData(
    dividerColor: Colors.transparent
  ),

Edit - second way

another way ... you can change every thing with this way(full customization) copy the file from flutter sdk to your lib

how to find the file :

click + ctrl on class name

click on target icon at here

right click on show in Explorer

then you should

  1. change the file name and copy this on your lib .
  2. fix imports
  3. change class name (very important) ( with right click and refactor)
  4. finally use it !! :)

这篇关于Flutter 移除边框扩展磁贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆