Represents a reflected Dart record type.
A Dart record consists of zero or more positional fields and optionally named fields. This interface provides access to both positional and named components of the record in a structured and introspectable form.
Example
(int, String, {bool active}) record = (1, "hello", active: true);
ReflectedRecord reflected = ...;
reflected.getPositionalFields(); // returns field for int and String
reflected.getNamedFields(); // returns map with 'active': bool
- Inheritance
-
- Object
- BaseDeclaration
- Declaration
- EntityDeclaration
- SourceDeclaration
- ClassDeclaration
- RecordDeclaration
- Implemented types
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode, andtoString.inherited -
getAnnotations(
) → List< AnnotationDeclaration> -
Returns all annotations applied to this declaration in source code.
inherited
-
getCanonicalUri(
) → Uri? -
Gets the canonical definition location.
inherited
-
getConstructors(
) → List< ConstructorDeclaration> -
Returns all constructors declared in this class.
inherited
-
getDebugIdentifier(
) → String -
Returns the stable debug identifier for this entity.
inherited
-
getField(
String fieldName) → FieldDeclaration? -
Returns a field by its
fieldName, ornullif no field with that name exists.inherited -
getFields(
) → List< FieldDeclaration> -
Returns all fields declared in this class, excluding inherited fields.
inherited
-
getHasInterfaces(
) → bool -
Returns
trueif this class implements one or more interfaces.inherited -
getInstanceFields(
) → List< FieldDeclaration> -
Returns all instance fields declared in this class or mixin.
inherited
-
getInstanceMethods(
) → List< MethodDeclaration> -
Returns all instance methods declared in this class or mixin.
inherited
-
getInterfaces(
) → List< LinkDeclaration> -
Returns the list of interfaces this type implements.
inherited
-
getIsAbstract(
) → bool -
Returns
trueif this class is markedabstract.inherited -
getIsBase(
) → bool -
Returns
trueif this class is declared as base.inherited -
getIsCanonical(
) → bool -
Checks if this reference points to its canonical definition.
inherited
-
getIsFinal(
) → bool -
Returns
trueif this class is declared as final.inherited -
getIsInterface(
) → bool -
Returns
trueif this class is declared as an interface.inherited -
getIsMixin(
) → bool -
Returns
trueif this declaration is amixinor a mixin application.inherited -
getIsNullable(
) → bool - Indicates whether this record type is nullable.
-
getIsPublic(
) → bool -
Indicates whether this declaration is publicly visible.
inherited
-
getIsRecord(
) → bool -
Returns
trueif this class represents a record class.inherited -
getIsSealed(
) → bool -
Returns
trueif this class is declared as sealed.inherited -
getIsSynthetic(
) → bool -
Indicates whether this declaration is synthetic.
inherited
-
getKind(
) → TypeKind -
Returns the TypeKind describing what kind of type this declaration represents.
inherited
-
getLibrary(
) → LibraryDeclaration -
Returns the LibraryDeclaration in which this class is declared.
inherited
-
getMembers(
) → List< MemberDeclaration> -
Returns all members declared in this class, including fields, methods, and constructors.
inherited
-
getMethod(
String methodName) → MethodDeclaration? -
Returns a method by its
methodName, ornullif no method with that name exists.inherited -
getMethods(
) → List< MethodDeclaration> -
Returns all methods declared in this class, excluding inherited methods.
inherited
-
getMixins(
) → List< LinkDeclaration> -
Returns the list of mixin identities that are applied to this type.
inherited
-
getName(
) → String -
Returns the simple (unqualified) name of this declaration.
inherited
-
getPackageUri(
) → String -
Returns the package URI in which this class is declared.
inherited
-
getPointerQualifiedName(
) → String -
Gets the fully qualified name of the pointer type.
inherited
-
getPointerType(
) → Type -
Gets the base pointer type being referenced.
inherited
-
getPositionalField(
int index) → RecordFieldDeclaration? -
Returns the positional field at the specified
index. -
getQualifiedName(
) → String -
Returns the fully-qualified identifier for this object.
inherited
-
getRecordField(
String name) → RecordFieldDeclaration? -
Returns the named field with the given
name. -
getRecordFields(
) → List< RecordFieldDeclaration> - Returns all fields declared by this record.
-
getReferenceUri(
) → Uri? -
Gets where this reference was found.
inherited
-
getSimpleName(
) → String -
Returns the simple (unqualified) name of this class.
inherited
-
getSourceLocation(
) → Uri? -
Returns the URI pointing to the source location where this declaration
is defined.
inherited
-
getStaticFields(
) → List< FieldDeclaration> -
Returns all static fields declared in this class or mixin.
inherited
-
getStaticMethods(
) → List< MethodDeclaration> -
Returns all static methods declared in this class or mixin.
inherited
-
getSuperClass(
) → LinkDeclaration? -
Returns the direct superclass of this type.
inherited
-
getType(
) → Type -
Returns the Dart Type represented by this declaration.
inherited
-
getTypeArguments(
) → List< LinkDeclaration> -
Returns the list of type arguments for generic types.
inherited
-
hasField(
String fieldName) → bool -
Checks if this class or mixin declares a field with the given
fieldName.inherited -
hasMethod(
String methodName) → bool -
Checks if this class or mixin declares a method with the given
methodName.inherited -
isGeneric(
) → bool -
Returns
trueif this class declares generic type parameters.inherited -
newInstance(
Map< String, dynamic> arguments) → dynamic -
Instantiates this class using the default (unnamed) constructor.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
serialize(
BinaryBuilder builder) → void -
Serializes this declaration to binary format.
inherited
-
toJson(
) → Map< String, Object> -
Serializes this declaration into a JSON-compatible map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited