NearbyMessageContent class abstract base

Abstraction for the message content. The NearbyMessageContentType is used to determine, what type of content is it.

Implementers

Constructors

NearbyMessageContent({required String id})
const
NearbyMessageContent.create()

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
final
isValid bool
Check for the content if it is valid for sending or receiving.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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 of json.