assignVar method

  1. @Deprecated('Use `declareVar(name).assign(expression)`')
Expression assignVar(
  1. String name, [
  2. Reference? type
])
inherited

Return var {name} = {this}.

Implementation

@Deprecated('Use `declareVar(name).assign(expression)`')
Expression assignVar(String name, [Reference? type]) => BinaryExpression._(
      type == null
          ? LiteralExpression._('var $name')
          : BinaryExpression._(
              type.expression,
              LiteralExpression._(name),
              '',
            ),
      this,
      '=',
    );