toggleAll method - AttributeClassSet class - dart:svg library (original) (raw)
void toggleAll(
inherited
Toggles all classes specified in iterable
on element.
Iterate through iterable
's items, and add it if it is not on it, or remove it if it is. This is the Dart equivalent of jQuery'stoggleClass. If shouldAdd
is true, then we always add all the classes in iterable
element. If shouldAdd
is false then we always remove all the classes initerable
from the element.
Implementation
void toggleAll(Iterable<String> iterable, [bool? shouldAdd]) {
iterable.forEach((e) => toggle(e, shouldAdd));
}