abr ahm
abr ahm

Reputation: 113

how to remove the padding betwen container and divider

so in this function i aim to display a row in which i have a title then a spacer then a value . I aim to color this value as if it was a colored column but i have problem i have some padding between the container and the divider and i want the line of the divider is just next to the container without any padding what is the problem

coloredRowTable(String title, String value) {
    return Column(
      children: [
        Row(
          children: [
            Text(
              title,
              style: const TextStyle(
                  fontSize: 17,
                  fontFamily: 'SFProRegular',
                  color: Color(0xFF131313)),
            ),
            const Spacer(),
            Container(
              padding: const EdgeInsets.only(bottom: 0.0, top: 0.0),
              color: Colors.green,
              height: 50,
              width: 50,
              child: Text(
                value,
                style: const TextStyle(
                    fontSize: 17,
                    fontFamily: 'SFProRegular',
                    color: Color(0xFF131313)),
              ),
            ),
          ],
        ),
        Divider(
          color: Colors.grey[300],
          indent: 0,
          thickness: 1,
        ),
      ],
    );
  }

Upvotes: 7

Views: 6076

Answers (3)

Boy
Boy

Reputation: 7497

Only setting the height to 0 is enough to remove the padding

Upvotes: 0

Skyturkish
Skyturkish

Reputation: 456

For such problems, go to on of the widget and read its parameters.if you try all of them , probably your problem will gone.

  Divider(
                color: Colors.grey[300],
                height: 0,
                indent: 0,
                thickness: 1,
              ),

Upvotes: 12

Krupupakku
Krupupakku

Reputation: 173

Have you tried to add height:0 to your divider?

Divider(
 height: 0,
 color: Colors.grey[300],
 indent: 0,
 thickness: 1,
),

Upvotes: 6

Related Questions