startConstCode method Null safety

void startConstCode(
  1. bool isConst,
  2. Null visit(

    Executes visit within a context which may alter the output if isConst is true.

    This allows constant expressions to omit the const keyword if they are already within a constant expression.


    void startConstCode(
      bool isConst,
      Null Function() visit,
    ) {
      final previousConstContext = _withInConstExpression;
      if (isConst) {
        _withInConstExpression = true;
      _withInConstExpression = previousConstContext;