Abstraction for the message content. The NearbyMessageContentType is used to determine, what type of content is it.
Constructors
- NearbyMessageContent({required String id})
-
const
- NearbyMessageContent.create()
Properties
Methods
-
byType<
T> ({T onTextRequest(NearbyMessageTextRequest)?, T onTextResponse(NearbyMessageTextResponse)?, T onFilesRequest(NearbyMessageFilesRequest)?, T onFilesResponse(NearbyMessageFilesResponse)?}) → T? -
The
onTextRequest
callback returns this instance of NearbyMessageContent, cast as NearbyMessageTextRequest if is a text.The
onFilesRequest
callback returns this instance of NearbyMessageContent, cast as NearbyMessageFilesRequest if is a files pack request.The
onFilesResponse
callback returns this instance of NearbyMessageContent, cast as NearbyMessageFilesResponse if is a files pack response. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Gets Map from NearbyMessageContent
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson<
C extends NearbyMessageContent> (Map< String, dynamic> ? json) → C -
Contains the conditional logic of creating NearbyMessageFilesRequest,
NearbyMessageFilesResponse or NearbyMessageTextRequest
by
type
field ofjson
.