qya
qya

Reputation: 3

flutter button has spacing at the top

Widget tabTitleDetails = Container(
      margin: EdgeInsets.symmetric(vertical: 8.0),
        decoration: BoxDecoration(
          color: Colors.white,
        
          border: Border.all(
            color: Colors.black,
            width: 8,
          ),
          borderRadius: BorderRadius.circular(12),
        ),
      
  
        child: Column(
          children: <Widget>[
            Container(
              padding: EdgeInsets.all(0.0) ,
              margin:EdgeInsets.all(0.0),
              child: Row(
                children: <Widget>[
                
                  RaisedButton(
                        onPressed: (){},
                        child:new Text('Sell')
                  ),
                      
                ],
              )
            ),
            numDetails
          ],
        )
    
      );

enter image description here

problems: this codes run ,the screen show the button is the distance from the top

Upvotes: 0

Views: 231

Answers (1)

mahesh
mahesh

Reputation: 4763

Add materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, to your FlatButton.

This is because Flutter has default button size to 48*48, so if your button size is less then that Flutter will provide padding to it. You can also increase the Height to greater than 48. Here is Flutter Source.

Upvotes: 1

Related Questions