FileData class

A Data object holding a link to a file, e.g. an audio recording or image.

The file itself is stored on the phone at path. A data manager can upload the file in addition to this metadata, if upload is true.

Inheritance
  • Object
  • Serializable
  • Data
  • FileData
Annotations
  • @JsonSerializable.new(includeIfNull: false, explicitToJson: true)

Constructors

FileData({required String filename, bool upload = true})
Creates a new FileData for filename and whether it is to be uploaded.
FileData.fromJson(Map<String, dynamic> json)
factory

Properties

$type ↔ String?
The type name written to __type in JSON; set to jsonType on creation.
getter/setter pairinherited
dataType → DataType
The type of this data as a DataType.
no setterinherited
filename ↔ String
The name of the attached file.
getter/setter pair
fromJsonFunction → Function
The generated function that converts a JSON map to an object of this type.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
jsonType → String
The __type used for JSON serialization of this class.
no setterinherited
metadata ↔ Map<String, String>?
Metadata for this file as a map of string key-value pairs.
getter/setter pair
path ↔ String?
The local path to the attached file on the phone where it is sampled. This is used by e.g. a data manager to get and manage the file on the phone.
getter/setter pair
recordId → String?
Stable identifier of the source record, if available; null by default.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
upload ↔ bool
Whether to upload the file too, or only this metadata. Default is true.
getter/setter pair

Methods

equivalentTo(Data other) → bool
Is this data equivalent to other?
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Returns a JSON map of this object, including the __type property.
override
toString() → String
A string representation of this object.
inherited

Operators

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