DirectusData class abstract

Implementers

Constructors

DirectusData(Map<String, dynamic> _rawReceivedData)
DirectusData.withId(dynamic id)
DirectusData.newDirectusData([Map<String, dynamic> _rawReceivedData = const {}])

Properties

hashCode int
The hash code for this object.
no setterinherited
id String?
Returns the id of the item We respect directus recommandations of having an id field for each collection. It can be null because a new item can be created without an id and will get its id generated by the server If you fetched the item from the server, it will have an id and it will certainly never be null
no setter
intId int?
Returns the id of the item if you used Integer as the id type in Directus
no setter
needsSaving bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
updatedProperties Map<String, dynamic>
final
userCreated String?
This field is used to store the id of the user that created the item.
getter/setter pair

Methods

getDateTime({required String forKey}) DateTime
Returns a DateTime for a given property. Only use this property if you are certain your property will be filled for every object in the collection If you are not certain, use getOptionalDateTime instead
getDirectusFile({required String forKey}) DirectusFile
getDirectusGeometryType({required String forKey}) DirectusGeometryType
Returns a DirectusGeometryType for a given property. Only use this property if you are certain your property will be filled for every object in the collection If you are not certain, use getOptionalDirectusGeometryType instead
getList<T>({required String forKey}) List<T>
Returns a list of the given type for a given property. Only use this property if you are certain your property will be of this type for every object in the collection If the property is not a list, an empty list will be returned
getObjectList<T>({required String forKey, required T fromMap(Map<String, dynamic>)}) List<T>
getOptionalDateTime({required String forKey}) DateTime?
Returns a DateTime if the value is a DateTime or a String that can be parsed as a DateTime This property can be used if you are not certain your property will be filled for every object in the collection
getOptionalDirectusFile({required String forKey}) DirectusFile?
getOptionalDirectusGeometryType({required String forKey}) DirectusGeometryType?
Returns a DirectusGeometryType if the value is a Map that can be converted to a DirectusGeometryType This property can be used if you are not certain your property will be filled for every object in the collection If the property is not a Map, null will be returned
getRawData() Map<String, dynamic>
getStringList({required String forKey}) List<String>
Returns a list of String for a given property. Only use this property if you are certain your property will be a list whose members can be converted to String using toString If the property is not a list, an empty list will be returned
getValue({required String forKey}) → dynamic
hasChangedIn({required String forKey}) bool
mapForObjectCreation() Map<String, dynamic>
Returns a map of all the properties of the item without the id that must not be sent to the server when creating a new item
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setOptionalDateTime(DateTime? value, {required String forKey}) → void
Sets a DateTime for a given property. if the value is null, the property will be removed from the updated properties
setOptionalDirectusFile(DirectusFile? file, {required String forKey}) → void
Set a DirectusFile to the value of the given key If the file is null, the value will be set to null
setValue(dynamic value, {required String forKey}) → void
toMap() Map<String, dynamic>
returns a map of all the properties of the item merged with the ones that have been updated
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

idKey → const String
userCreatedKey → const String