declareVar function Null safety

Expression declareVar(
  1. String variableName,
  2. {Reference? type,
  3. bool late = false}
)

Declare a variable named variableName.

Returns var {variableName}, or {type} {variableName}. If late is true the declaration is prefixed with late.

Implementation

Expression declareVar(String variableName,
        {Reference? type, bool late = false}) =>
    _late(
        late,
        type == null
            ? LiteralExpression._('var $variableName')
            : _typedVar(variableName, type));