RobotsMeta class

Manages per-page robots meta directives.

Controls how search engines index and follow links on each page.

// Allow indexing and following
RobotsMeta.set(index: true, follow: true);

// Prevent indexing but allow following links
RobotsMeta.set(index: false, follow: true);

// Full control
RobotsMeta.setDirective('noindex, nofollow, noarchive, nosnippet');

See: https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag

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
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

allowAll() → void
Common preset: allow everything
blockAll() → void
Common preset: block everything
Common preset: noindex but follow links
remove() → void
Remove the robots meta tag (defaults to index,follow)
set({bool index = true, bool follow = true, bool archive = true, bool snippet = true, bool imageIndex = true, int? maxSnippet, int? maxImagePreview, int? maxVideoPreview}) → void
Set robots directive using boolean flags
setDirective(String directive) → void
Set a raw robots directive string
setForBot(String botName, String directive) → void
Set robots directive for a specific bot