Merkelst
Merkelst

Reputation: 311

Dart — onclick action add/remove class

Now I'm learn Dartlang and don't understand how on this language write onClick action for some cases. I know, it's like a java, but i confused. Example: simple case. I have element with class "button" and div element with "dropdown" class. How to add/remove "open" class to "dropdown" element after click element with "button" class?

void dropdown(part) {
...
}

Upvotes: 2

Views: 414

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657871

This might be what you're looking for

querySelector('.button').onClick.listen((event) => dropdown(...));

Upvotes: 3

Related Questions