description

# startSync method Null safety

void startSync (

1. String name,
2. {Map? arguments,
3. Flow? flow}

)

Start a synchronous operation labeled `name`. Optionally takes a Map of `arguments`. This slice may also optionally be associated with a Flow event. This operation must be finished before returning to the event queue.

## Implementation

    static void startSync(String name, {Map? arguments, Flow? flow}) {
      if (!_hasTimeline) return;
      // TODO: When NNBD is complete, delete the following line.
      ArgumentError.checkNotNull(name, 'name');
      if (!_isDartStreamEnabled()) {
        // Push a null onto the stack and return.
        _stack.add(null);
        return;
      }
      var block = new _SyncBlock._(name);
      if (arguments != null) {
        block._arguments = arguments;
      }
      if (flow != null) {
        block.flow = flow;
      }
      _stack.add(block);
      block._startSync();
    }