toggle abstract method

bool toggle(
  1. String value, [
  2. bool? shouldAdd
])

Adds the class value to the element if it is not on it, removes it if it is.

If shouldAdd is true, then we always add that value to the element. If shouldAdd is false then we always remove value from the element.

Implementation

bool toggle(String value, [bool? shouldAdd]);