BloomRouteMetadata class
Declarative SEO, OpenGraph, and Twitter Card metadata configuration for Bloom routes.
Used by SSR/SSG compilers to inject semantic <meta>, <title>, <link rel="canonical">,
and JSON-LD structured <script> tags into the rendered HTML <head>.
Example:
const metadata = BloomRouteMetadata(
title: 'Documentation | Bloom',
description: 'Learn how to build modern apps with Bloom',
canonical: 'https://bloom.dev/docs',
openGraph: OpenGraph(title: 'Bloom Docs'),
);
final htmlHeadTags = metadata.renderHtmlTags();
Constructors
-
BloomRouteMetadata({String? title, String? description, String? canonical, OpenGraph? openGraph, TwitterCard? twitterCard, Map<
String, String> metaTags = const {}, Map<String, dynamic> ? jsonLd}) -
Creates a BloomRouteMetadata configuration.
const
Properties
- canonical → String?
-
Canonical URL for duplicate content indexing prevention.
final
- description → String?
-
Meta description summary for search engine optimization.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
jsonLd
→ Map<
String, dynamic> ? -
JSON-LD structured data payload.
final
-
metaTags
→ Map<
String, String> -
Additional custom meta tag name-to-content mappings.
final
- openGraph → OpenGraph?
-
OpenGraph metadata for social media platforms.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String?
-
Document title displayed in browser tab and search snippets.
final
- twitterCard → TwitterCard?
-
Twitter Card metadata configuration.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
renderHtmlTags(
) → String - Renders SEO, OpenGraph, and Twitter Card HTML elements.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited