declareVariable method
Implementation
String? declareVariable(CodeBlock block, [String? type]) {
if (isVariableDeclared) {
return variable;
}
final expression = matcher.expression;
if (!expression.resultUsed) {
return null;
}
isVariableDeclared = true;
allocateVariable();
type ??= nullableType(expression.resultType);
block.declare(variable!, ref(type));
return variable;
}