monitorClipboard method

void monitorClipboard(
  1. bool add,
  2. void listener()
)

Implementation

void monitorClipboard(bool add, void Function() listener) {
  if (kIsWeb) return;
  if (add) {
    _timer = Timer.periodic(
        const Duration(seconds: 1), (timer) => _update(listener));
  } else {
    _timer?.cancel();
  }
}