FieldDefinition class

Field definition for an entity

Constructors

FieldDefinition({required String name, required String type, bool nullable = false, String? jsonName, bool isExternal = false})
const
FieldDefinition.parse(String definition)
Parses a field definition in one of three forms:
factory

Properties

fullType → String
no setter
hashCode → int
The hash code for this object.
no setterinherited
isExternal → bool
True when the type was written with the ! prefix (e.g. url:!WebUri?), marking it as EXTERNAL — a type that lives outside the entity tree (plugin wrappers like WebUri, SDK classes, ...). External types are kept as-is: no $ prefix is added by FieldNormalizer, no entity/enum import is resolved by ImportResolver, and on-disk validation is skipped. The user is responsible for importing the type in the generated entity source.
final
jsonName → String?
Optional JSON wire name for the field, when it differs from the Dart name. Needed for GraphQL fields whose wire name is a Dart-reserved keyword (in, required) or that legitimately differ on the wire (Vendure's _and / _or filter operators). When set, the generated source getter carries @JsonKey(name: '<jsonName>'), which the zorphy builder already propagates into the concrete class and json_serializable output.
final
name → String
final
nullable → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → String
final

Methods

copyWith({String? name, String? type, bool? nullable, String? jsonName, bool? isExternal}) → FieldDefinition
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