JsonLdSchema class abstract

Base class for all JSON-LD structured data schemas.

Extend this to create custom schema types, or use the built-in schemas like OrganizationSchema, ProductSchema, etc.

class MySchema extends JsonLdSchema {
  final String name;
  MySchema({required this.name});

  @override
  Map<String, dynamic> toMap() => {
    '@type': 'Thing',
    'name': name,
  };
}
Implementers

Constructors

JsonLdSchema()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJsonLd() String
Convert to a complete JSON-LD string with @context.
toJsonLdMinified() String
Convert to a minified JSON-LD string (no extra whitespace).
toMap() Map<String, dynamic>
Convert this schema to a map (without @context). Subclasses must implement this.
toString() String
A string representation of this object.
override

Operators

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