Arda Senoglu
Arda Senoglu

Reputation: 37

Flutter comparing a value with two strings

Here I want to compare the currentvalue with the two strings I gave and I want to create a widget accordingly, but I can only check if it is equal to one string.

Widget buildSecondDropDown() {
    return currentValue == "Kare" && "Dikdörtgen"
        ? Container(
            width: 200,
            padding: const EdgeInsets.symmetric(
              horizontal: 12,
              vertical: 4,
            ),
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(12),
              color: Colors.white,
            ),
          )
        : Container();
  }

Upvotes: 1

Views: 1229

Answers (1)

user15118945
user15118945

Reputation:

try replace line 2 :

return currentValue == "Kare" && currentValue == "Dikdörtgen"

This should work

Upvotes: 4

Related Questions