activeNonBlockingToolTasks property

Map<String, Future<void>>? get activeNonBlockingToolTasks

Active background tasks executing non-blocking tools in Live mode.

Implementation

Map<String, Future<void>>? get activeNonBlockingToolTasks {
  if (_hasNonBlockingTasksView ||
      activeBackgroundTools.values.any(
        ActiveNonBlockingToolTasksView._isTaskEntry,
      )) {
    _hasNonBlockingTasksView = true;
    return _activeNonBlockingToolTasksView ??= ActiveNonBlockingToolTasksView(
      () => activeBackgroundTools,
    );
  }
  return null;
}
set activeNonBlockingToolTasks (Map<String, Future<void>>? value)

Implementation

set activeNonBlockingToolTasks(Map<String, Future<void>>? value) {
  if (value == null) {
    _hasNonBlockingTasksView = false;
    activeBackgroundTools.removeWhere(
      (_, ActiveBackgroundTool entry) =>
          ActiveNonBlockingToolTasksView._isTaskEntry(entry),
    );
    return;
  }
  _hasNonBlockingTasksView = true;
  final ActiveNonBlockingToolTasksView view =
      _activeNonBlockingToolTasksView ??= ActiveNonBlockingToolTasksView(
        () => activeBackgroundTools,
      );
  if (!identical(value, view)) {
    final Map<String, Future<void>> snapshot =
        Map<String, Future<void>>.from(value);
    view.clear();
    view.addAll(snapshot);
  }
}