toggle method

void toggle([
  1. String? display
])

Implementation

void toggle([String? display]) {
  element?.style.display =
      element?.style.display == 'none' ? display ?? 'block' : 'none';
}