Head class

Component that synchronizes page title and head metadata.

Inheritance

Constructors

Head({String? title, String? description, String? canonical, String? image, String? type, String? siteName, String? locale, bool replace = true, List<HeadTag> tags = const []})
Creates a head component from common SEO fields and custom tags.
Head.seo({String? title, String? description, String? canonical, String? image, String? type = 'website', String? siteName, String? locale, List<HeadTag> tags = const []})
Creates a head component with common SEO and Open Graph metadata.
Head.withTags(List<HeadTag> tags, {String? title})
Creates a head component from raw tags.

Properties

canonical → String?
Canonical URL and Open Graph URL.
final
description → String?
Meta description and Open Graph description.
final
hashCode → int
The hash code for this object.
no setterinherited
image → String?
Open Graph image URL.
final
locale → String?
Open Graph locale value.
final
preserveState → bool
Whether Flint should preserve this component instance across parent rerenders when the runtime type and tree position match.
no setterinherited
replace → bool
Whether matching existing head tags should be reused and updated.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
siteName → String?
Open Graph site name.
final
tags → List<HeadTag>
Additional head tags to synchronize.
final
title → String?
Browser document title and Open Graph title.
final
type → String?
Open Graph type value.
final

Methods

attach(void scheduleRender()) → void
Attaches the render scheduler used by setState.
inherited
build() → FlintNode
Renders no visible nodes because this component only updates <head>.
override
didMount() → void
Synchronizes metadata after the component first mounts.
override
didUpdate() → void
Synchronizes metadata after the component updates.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setState(FlintStateUpdater update, {bool render = true}) → void
Applies update and schedules this component to render again.
inherited
shouldUpdate(covariant FlintComponent next) → bool
Whether this component should rerender when it is updated from a new instance in the parent tree.
inherited
toString() → String
A string representation of this object.
inherited
updateFrom(covariant FlintComponent next) → void
Receives the next component instance when Flint preserves this instance.
inherited
willUnmount() → void
Called before the component is removed from the tree.
inherited

Operators

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

Static Methods

Creates a link head tag descriptor.
meta({String? charset, String? name, String? content, String? property, Map<String, Object?> props = const {}}) → HeadTag
Creates a meta head tag descriptor.
script({String? src, String? content, bool defer = false, bool async = false, Map<String, Object?> props = const {}}) → HeadTag
Creates a script head tag descriptor.
style(String content, {Map<String, Object?> props = const {}}) → HeadTag
Creates a style head tag descriptor.