ResourceContent extension type
2.x's ResourceContent: an embedded resource content block. A type as
well as a constructor; the value is the EmbeddedResource itself, read
through the 2.x members (uri, text, blob, mimeType and
annotations as a map).
- on
- Implemented types
Constructors
-
ResourceContent({required String uri, String? mimeType, String? text, String? blob, Object? annotations, Map<
String, Object?> ? meta}) -
annotationsis the 2.x map or an Annotations. -
ResourceContent.fromJson(Map<
String, dynamic> json) -
Reads an embedded resource content block; the flat form 2.x also read
(
{"type": "resource", "uri": …, "text": …}) is nested as the specification has it. - ResourceContent.of(EmbeddedResource block)
- Any embedded resource viewed under the 2.x name.
Properties
-
annotations
→ Map<
String, dynamic> ? -
The annotations as a map (2.x).
no setter
- blob → String?
-
The base64 data, for binary contents.
no setter
-
extra
→ Map<
String, Object?> -
Keys outside the schema (newer revisions, extensions, applications).
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
meta
→ Map<
String, Object?> ? -
no setterinherited
- mimeType → String?
-
The resource's MIME type, when given.
no setter
- resource → ResourceContents
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
schemaKeys
→ Set<
String> -
Property names the schema defines for this type.
no setterinherited
- text → String?
-
The text, for text contents.
no setter
- type → String
-
no setterinherited
- uri → String
-
The resource's URI.
no setter
Methods
-
$optional<
T> (String key, T? read(Object? value, String path)) → T? -
Optional property
key, converted byread;nullwhen absent or null.inherited -
$required<
T> (String key, T read(Object? value, String path)) → T -
Required property
key, converted byread.inherited -
check(
) → List< String> -
Reads every property this type defines and returns what could not be
read (missing required properties, wrong types), nested types included.
Empty = the JSON matches the schema's shape for this type.
inherited
-
copyWith(
{Annotations? annotations, ResourceContents? resource, Map< String, Object?> ? meta}) → EmbeddedResource -
A copy with the given properties replaced; everything else, unknown
keys included, is kept.
inherited
-
has(
String key) → bool -
Whether
keyis present (anullvalue counts as present).inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
The JSON form of this value.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
Equal when the JSON is equal; key order does not matter.
inherited
-
operator [](
String key) → Object? -
The raw JSON value of
key.inherited