Constant class sealed

Base class for representing compile-time constant values.

This abstract class provides a common interface for accessing and checking different types of constant values. Each subtype represents a specific kind of Dart constant (primitive values, collections, objects).

Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
isBool bool
Whether this constant represents a boolean value.
no setter
isDouble bool
Whether this constant represents a double value.
no setter
isEnumValue bool
Whether this constant represents an enum value.
no setter
isFunctionReference bool
Whether this constant represents a function reference.
no setter
isInt bool
Whether this constant represents an integer value.
no setter
isInvalid bool
Whether this constant represents an invalid constant.
no setter
isList bool
Whether this constant represents a list.
no setter
isMap bool
Whether this constant represents a map.
no setter
isNull bool
Whether this constant represents null.
no setter
isNum bool
Whether this constant represents a numeric value.
no setter
isObject bool
Whether this constant represents an object.
no setter
isSet bool
Whether this constant represents a set.
no setter
isString bool
Whether this constant represents a string value.
no setter
isSymbol bool
Whether this constant represents a symbol.
no setter
isType bool
Whether this constant represents a type reference.
no setter
literalValue Object?
The literal Dart value represented by this constant.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

invalid → const Constant
A special constant representing an invalid or unresolvable constant.