ConstantReader class abstract
A wrapper for analyzer's DartObject with a predictable high-level API.
Unlike DartObject.getField, the read method attempts to access super
classes for the field value if not found.
Constructors
- ConstantReader(DartObject? object)
-
factory
Properties
- boolValue → bool
-
Constant as a
boolvalue.no setter - doubleValue → double
-
Constant as a
doublevalue.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- intValue → int
-
Constant as a
intvalue.no setter - isBool → bool
-
Whether this constant represents a
boolvalue.no setter - isDouble → bool
-
Whether this constant represents a
doublevalue.no setter - isInt → bool
-
Whether this constant represents an
intvalue.no setter - isList → bool
-
Whether this constant represents a
Listvalue.no setter - isLiteral → bool
-
Whether this constant is a literal value.
no setter
- isMap → bool
-
Whether this constant represents a
Mapvalue.no setter - isNull → bool
-
Whether this constant is a
nullvalue.no setter - isSet → bool
-
Whether this constant represents a
Setvalue.no setter - isString → bool
-
Whether this constant represents a
Stringvalue.no setter - isSymbol → bool
-
Whether this constant represents a
Symbolvalue.no setter - isType → bool
-
Whether this constant represents a
Typevalue.no setter -
listValue
→ List<
DartObject> -
Constant as a
Listvalue.no setter - literalValue → Object?
-
Constant as a literal value.
no setter
-
mapValue
→ Map<
DartObject?, DartObject?> -
Constant as a
Mapvalue.no setter - objectValue → DartObject
-
Underlying object this instance is reading from.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
setValue
→ Set<
DartObject> -
Constant as a
Setvalue.no setter - stringValue → String
-
Constant as a
Stringvalue.no setter - symbolValue → Symbol
-
Constant as a
Symbolvalue.no setter - typeValue → DartType
-
Constant as a
DartTyperepresenting aTypevalue.no setter
Methods
-
instanceOf(
TypeChecker checker) → bool -
Whether the value this constant represents matches
checker. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
peek(
String field) → ConstantReader? -
Reads
fieldfrom the constant as another constant value. -
read(
String field) → ConstantReader -
Reads
fieldfrom the constant as another constant value. -
revive(
) → Revivable - Returns as a revived meta class.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited