VariableDeclaration class final

A variable declaration.

This defines or sets a variable.

Implemented types

Constructors

VariableDeclaration(String name, Expression expression, FileSpan span, {String? namespace, bool guarded = false, bool global = false, SilentComment? comment})

Properties

comment SilentComment?
The comment immediately preceding this declaration.
getter/setter pair
expression Expression
The value the variable is being assigned to.
final
hashCode int
The hash code for this object.
no setterinherited
isGlobal bool
Whether this is a global assignment.
final
isGuarded bool
Whether this is a guarded assignment.
final
name String
The name of the variable, with underscores converted to hyphens.
final
namespace String?
The namespace of the variable being set, or null if it's defined or set without a namespace.
final
namespaceSpan → FileSpan?
no setter
nameSpan → FileSpan
The span containing this declaration's name.
no setteroverride
originalName String
The variable name as written in the document, without underscores converted to hyphens and including the leading $.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
span → FileSpan
The source span associated with the node.
final

Methods

accept<T>(StatementVisitor<T> visitor) → T
Calls the appropriate visit method on visitor.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited