2

I have a container which look like this enter image description here

which has some background color. I want the list behind the container should be visible. The code written for the container is below:

 new Container(
                  margin: EdgeInsets.fromLTRB(50.0, 10.0, 50.0, 10.0),
                  width: _isTextFieldActive ? 150.0 : 80.0,
                  height: 40.0,
                  decoration: new BoxDecoration(
                      color: Color(0xFF98DAFC),
                      borderRadius: new BorderRadius.only(
                          topLeft: Radius.circular(0.0),
                          topRight: Radius.circular(32.0),
                          bottomLeft: Radius.circular(0.0),
                          bottomRight: Radius.circular(32.0))),
                  alignment: Alignment.bottomCenter,
                  child: new Row(
                    children: <Widget>[
                      new Container(
                          width: 40.0,
                          height: 40.0,
                          child: new Checkbox(value: true)),
                      new Container(
                              width: 40.0,
                              height: 40.0,
                              decoration: new BoxDecoration(
                                  color: Color(0xFFDEDEDE),
                                  borderRadius:
                                      new BorderRadius.circular(32.0)),
                              child: new IconButton(
                                icon: Icon(Icons.search),
                               );
                                  }
                                },
                              ))
                    ],
                  ),
                ),

so,i want that container without background color and the list behind the container should visible

if i remove the above code i am getting the screen as below. enter image description here

konda rahul
  • 141
  • 1
  • 1
  • 11

1 Answers1

1

I'm not 100% sure whether that's true, because I'm not able to test it right now, but I think the problem might be the margin property. If I understand you right, you want to have the Container in the bottom center with a bottom padding of 10dp. I would do it like that instead:

Align(
  alignment: Alignment.bottomCenter,
  child: Padding(
    padding: const EdgeInsets.only(bottom: 10.0),
    child: Container(
      height: 40.0,
      decoration: BoxDecoration(
        color: Color(0xFF98DAFC),
        borderRadius: const BorderRadius.only(
          topLeft: Radius.circular(0.0),
          topRight: Radius.circular(32.0),
          bottomLeft: Radius.circular(0.0),
          bottomRight: Radius.circular(32.0),
        ),
      ),
      child: ...,
    ),
  ),
)