Mikhail Mikhail - 8 months ago 104
Dart Question

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) {
...
}

Answer Source

This might be what you're looking for

querySelector('.button').onClick.listen((event) => dropdown(...));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download