Rahul Mishra
Rahul Mishra

Reputation: 4573

Row text padding issue in flutter

I am trying to add multiple lines of content in the row with the button but there is some padding issue...How to separate padding for Text

    return Container(
                        alignment: Alignment.topLeft,
                        height: 30.0,
                        child: Row(
                          crossAxisAlignment: CrossAxisAlignment.stretch,
                          //mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: <Widget>[
                            Container(child: Text("${address1+', '+address2+', '+city+', '+state+', '+country}")),
                            IconButton(
                              padding: EdgeInsets.all(1.0),
                              icon: Icon(Icons.edit,size: 20.0,), 
                              onPressed: () => print("a")
                            )
                          ],
                        ),
                      );

Upvotes: 0

Views: 5452

Answers (1)

Ricardo Gon&#231;alves
Ricardo Gon&#231;alves

Reputation: 5074

You add padding in any widget with Padding Widget

return Container(
    alignment: Alignment.topLeft,
    height: 30.0,
    child: Row(
      crossAxisAlignment: CrossAxisAlignment.stretch,
      //mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: <Widget>[
        Container(
            child: Padding(
                padding: const EdgeInsets.all(5.0),
                child: Text("${address1+', '+address2+', '+city+', '+state+', '+country}")),
            )
        ),
        IconButton(
          padding: EdgeInsets.all(1.0),
          icon: Icon(Icons.edit,size: 20.0,), 
          onPressed: () => print("a")
        )
      ],
    ),
);

Upvotes: 2

Related Questions