Field class

Represents a field, its name, type, and its nullability. Similar to TFieldRecord.

Constructors

Field({String? fieldName, String? fieldType, bool? nullable})
const
Field.from(Field source)
Derives an instance Field from source.
factory
Field.fromRecord(TFieldRecord record)
Derives an instance Field from record.
factory
Field.string(String? fieldName)
const
Field.stringOrNull(String? fieldName)
const

Properties

fieldName String?
The name of the field.
final
fieldType String?
The type of the field, e.g. 'String'.
final
fieldTypeCode String?
The type code of the field (the type with any special, characters, such as 'String?').
no setter
hashCode int
The hash code for this object.
no setterinherited
nullable bool?
Whether fieldType is nullable or not.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toRecord TFieldRecord
Converts this to a TFieldRecord.
no setter

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

Static Methods

fieldNameOrNull(dynamic unknown) String?
Assumes unknown is a TFieldRecord or Field or similar and tries to get the fieldName property, or returns null.
fieldTypeOrNull(dynamic unknown) String?
Assumes unknown is a TFieldRecord or Field or similar and tries to get the fieldType property, or returns null.
nullableOrNull(dynamic unknown) bool?
Assumes unknown is a TFieldRecord or Field or similar and tries to get the nullable property, or returns null.
ofOrNull(dynamic unknown) Field?
Assumes unknown is a TFieldRecord or Field or similar and tries to construct a Field, otherwise returns null.