VariableDeclaration class Null safety AST

A variable declaration.

This defines or sets a variable.

Implemented types
Annotations

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.
read / write
expression Expression
The value the variable is being assigned to.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
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?
read-only
nameSpan FileSpan
The span containing this declaration's name. [...]
read-only, override
originalName String
The variable name as written in the document, without underscores converted to hyphens and including the leading $. [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
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 non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
override

Operators

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