Contents class

Represents a collection of content items.

Constructors

Contents(List<Content> values)
Creates contents from a list of content items.
const
Contents.fromJson(Object? json)
Creates contents from JSON-compatible values.
factory
Contents.single(Content content)
Creates contents from a single content item.
factory
Contents.text(String text)
Creates contents from a text string.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Whether the contents are empty.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
The text content of the contents.
no setter
values List<Content>
The list of content items.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Object
Converts this contents object to JSON-compatible values.
toJsonString() String
Converts this contents object to a JSON string.
toString() String
A string representation of this object.
inherited

Operators

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

Constants

empty → const Contents
Empty contents.