FieldDeclaration constructor

const FieldDeclaration()

Represents a field (variable) declared within a Dart class, extension, enum, or mixin.

Provides access to its type, modifiers (final, late, const, static), and the ability to read or write its value at runtime.

Example

class Person {
  final String name;
  static int count = 0;
}

final field = reflector.reflectField(Person, 'name');
print(field.getIsFinal()); // true
print(field.getTypeDeclaration().getName()); // String

final p = Person('Jet');
print(field.getValue(p)); // Jet

Implementation

const FieldDeclaration();