startConstCode method
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.
Implementation
void startConstCode(
bool isConst,
Null Function() visit,
) {
final previousConstContext = _withInConstExpression;
if (isConst) {
_withInConstExpression = true;
}
visit();
_withInConstExpression = previousConstContext;
}