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
- 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
-
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) → void -
Applies
updateand schedules this component to render again.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
-
link(
{required String href, String rel = 'stylesheet', Map< String, Object?> props = const {}}) → HeadTag -
Creates a
linkhead tag descriptor. -
meta(
{String? charset, String? name, String? content, String? property, Map< String, Object?> props = const {}}) → HeadTag -
Creates a
metahead tag descriptor. -
script(
{String? src, String? content, bool defer = false, bool async = false, Map< String, Object?> props = const {}}) → HeadTag -
Creates a
scripthead tag descriptor. -
style(
String content, {Map< String, Object?> props = const {}}) → HeadTag -
Creates a
stylehead tag descriptor.