Attachment class
An Attachment model to convert a MediaUri TO a Map
to send as an
extraData
along an activity or a reaction. For example:
final bloc = FeedProvider.of(context).bloc;
final uploadController = bloc.uploadController;
final extraData = uploadController.getMediaUris()?.toExtraData();
await bloc.onAddReaction( kind: 'comment', data: extraData,
activity: parentActivity, feedGroup: feedGroup );
The attachment model is also useful to convert FROM extraData in an activity
or reaction via the toAttachments
extension. For example:
final attachments = activity.extraData?.toAttachments()
Constructors
- Attachment({required String url, required MediaType mediaType})
-
const
-
Attachment.fromJson(Map<
String, dynamic> json) -
factory
- Attachment.fromMedia(MediaUri mediaUri)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- mediaType → MediaType
-
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited - url → String
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited