ClientPost class
A client object (article, product, recipe, event, …) to link to an Octopus post.
ClientPost describes the post the SDK should fetch — or create, if it does
not exist yet — for an external object from your app. It is the input to
OctopusSDK.fetchOrCreateClientObjectRelatedPost.
Mirrors the native ClientPost public surface. Field names follow Android
(the reference SDK). Like Android, this model carries no signature/token
field: authorization for creating a new post is supplied lazily through the
token-provider callback on the fetch-or-create method, not on the model
itself.
- Annotations
Constructors
-
ClientPost({required String objectId, required String text, @Deprecated('Use medias.') OctopusClientPostAttachment? attachment, String? catchPhrase, @Deprecated('Use viewObjectButton: OctopusLocalizedText.autoTranslated(text) to keep ' 'the automatic translation, or OctopusLocalizedText.perLanguage to give ' 'the label per language.') String? viewObjectButtonText, String? groupId, List<
OctopusClientPostAttachment> medias = const [], OctopusLocalizedText? viewObjectButton}) -
Creates a client-object post payload.
const
Properties
- attachment → OctopusClientPostAttachment?
-
The deprecated single image attachment — local bytes or a remote URL.
final
- catchPhrase → String?
-
Optional catch phrase displayed in bold below the text (e.g. "What do you
think about this?"). Keep it short. When
null, none is shown.final - groupId → String?
-
Optional group the post is categorised under. When
null, a default group (configured with the Octopus backend team) is used.final - hashCode → int
-
The hash code for this object.
no setteroverride
-
medias
→ List<
OctopusClientPostAttachment> -
The images of the post, in display order — each one local bytes or a
remote URL. Empty by default.
final
- objectId → String
-
Stable identifier of the external object this post is linked to. Used to
retrieve the post if it already exists and to drive the host's
"open client object" navigation callback.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String
-
Main post text. Must be 1–5000 characters (validated by the native editor
at creation time).
final
- viewObjectButton → OctopusLocalizedText?
-
Optional label for the button that opens the linked client object,
auto-translated or given per language. When tapped, the host's "open
client object" navigation callback fires with objectId. When
null, the button is not shown.no setter - viewObjectButtonText → String?
-
The label of the button that opens the linked client object: the text
itself when auto-translated, the text of the default language when given
per language.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - The platform-channel representation handed to the native bridges.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override