assignConst method

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

Return const {name} = {this}.

Implementation

@Deprecated('Use `declareConst(name).assign(expression)`')
Expression assignConst(String name, [Reference? type]) => BinaryExpression._(
      type == null
          ? const LiteralExpression._('const')
          : BinaryExpression._(
              const LiteralExpression._('const'),
              type.expression,
              '',
            ),
      this,
      '$name =',
      isConst: true,
    );