Question: I'm trying to build an app in flutter and I'm using

```
Scaffold(
      appBar: AppBar(
        title: Text("Login"),
      ),
      body: Text("Hello there")
);

```

the issues i'm facing is that the body text doesn't have the same padding as the appbar one has.

![img](https://i.imgur.com/l5UskLl.png)

So how can i find the default padding value to use it so i can have aligned text or widget with the same padding?

Thanks in advance.

Answer: 
Well i don't think app bar have default padding values which you can get but you can probably get its height value by using its property. Below i have written a code which extracts appbar height. And using that height i made a container and added text as its child and aligned it to leftCenter. Then applied 16 padding on left and right. So the output is same as the appBar.

[![enter image description here](https://i.stack.imgur.com/stYxb.png)](https://i.stack.imgur.com/stYxb.png)

```
Widget build(BuildContext context) {
    AppBar appbar = AppBar(
      title: Text('Login'),
    );
    double appBarHeight = appbar.preferredSize.height;
    return Scaffold(
      appBar: appbar,
      body: Container(
        padding: EdgeInsets.only(left: 16, right: 16),
        color: Colors.blue[100],
        alignment: Alignment.centerLeft,
        height: appBarHeight,
        child: Text(
          'Login',
          style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600),
        ),
      ),
    );

```
you can always use the [container](https://api.flutter.dev/flutter/widgets/Container-class.html) widget

> 
> A convenience widget that combines common painting, positioning, and sizing widgets.
> A container first surrounds the child with padding (inflated by any borders present in the decoration) and then applies additional constraints to the padded extent (incorporating the width and height as constraints, if either is non-null). The container is then surrounded by additional empty space described from the margin.
> 
> 
> 

```
Container(
padding:EdgeInsets.all(8)
child:Text("Hello there"))

```

From this you can play with padding ,margin.

also there is a [padding](https://api.flutter.dev/flutter/widgets/Padding-class.html) widget

> 
> A widget that insets its child by the given padding.
> 
> 
>