FieldType enum

Defines a key-value field of a robots.txt file specifying a rule.

Inheritance

Constructors

FieldType({required String key, required String example})
Constructs a FieldType.
const

Values

userAgent → const FieldType

A field specifying the user-agent the following fields apply to.

const FieldType(key: 'User-agent', example: '*')
disallow → const FieldType

A field explicitly disallowing a user-agent to visit a path.

const FieldType(key: 'Disallow', example: '/')
allow → const FieldType

A field explicitly allowing a user-agent to visit a path.

const FieldType(key: 'Allow', example: '/file.txt')
sitemap → const FieldType

A field specifying the location of a sitemap of a website.

const FieldType(key: 'Sitemap', example: 'https://example.com/sitemap.xml')
crawlDelay → const FieldType

A field specifying a delay that crawlers should take into account when crawling the website.

const FieldType(key: 'Crawl-delay', example: '10')
host → const FieldType

A field specifying the preferred domain for a website with multiple mirrors.

const FieldType(key: 'Host', example: 'https://hosting.example.com')

Properties

example String
An example of a field definition. Used for testing.
final
hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
key String
The name of the field key.
final
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
toField([String? value]) String
Converts a FieldType to a robots.txt field.
toString() String
A string representation of this object.
override

Operators

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

Static Properties

defaultFieldNameExpression String
A partial regular expression defining a union of the default field names.
final

Static Methods

byKey(String key) FieldType?
Attempts to resolve key to a FieldKey corresponding to that key. Returns null if not found.

Constants

rules → const List<FieldType>
Contains the field types that introduce rules.
values → const List<FieldType>
A constant List of the values in this enum, in order of their declaration.