toggle method

Future<bool> toggle([
  1. T? replacement
])

Implementation

Future<bool> toggle([T? replacement]) async {
  final visible = this.visible;
  if (visible) {
    await this.hide();
  } else {
    await this.show(replacement);
  }
  return visible;
}