2

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

nvoigt
  • 75,013
  • 26
  • 93
  • 142
user3808307
  • 2,270
  • 9
  • 45
  • 99

1 Answers1

3

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
  • 7,098
  • 7
  • 27
  • 53