1

I see this answer for conditional color

I am trying to do the same for padding like so

Padding(
  padding: const EdgeInsets.only(bottom: isLogin ? 58.0 : 10.0),
)

it is not being accepted.

Thank you

user3808307
  • 1,658
  • 8
  • 29
  • 78

1 Answers1

1

You can use it like this:

            padding: isLogin
                ? EdgeInsets.only(bottom: 58.0)
                : EdgeInsets.only(bottom: 10.0),

Edit:

or just remove const like this.

            padding: EdgeInsets.only(bottom: isLogin ? 58.0 : 10.0),

You can read the usage of const from here.

Akif
  • 6,084
  • 7
  • 20
  • 47