SeoText class
Renders text with proper semantics for search engine crawlers.
On web, this ensures the text is accessible to crawlers through Flutter's accessibility/semantics tree. On other platforms, it renders as a normal Text widget.
// Regular paragraph
SeoText('Welcome to our amazing product')
// Heading
SeoText.heading(
'Product Features',
style: Theme.of(context).textTheme.headlineLarge,
)
// Subheading
SeoText.subheading('Built with Flutter')
- Inheritance
Constructors
- SeoText(String text, {Key? key, TextStyle? style, TextAlign? textAlign, String htmlTag = 'p', int? maxLines, TextOverflow? overflow, TextDirection? textDirection})
-
const
- SeoText.heading(String text, {Key? key, TextStyle? style, TextAlign? textAlign, int? maxLines, TextOverflow? overflow, TextDirection? textDirection})
-
Creates an SEO-friendly h1 heading
const
- SeoText.headingLevel(String text, {Key? key, required int level, TextStyle? style, TextAlign? textAlign, int? maxLines, TextOverflow? overflow, TextDirection? textDirection})
-
Creates an SEO-friendly heading with custom level (1-6)
const
- SeoText.subheading(String text, {Key? key, TextStyle? style, TextAlign? textAlign, int? maxLines, TextOverflow? overflow, TextDirection? textDirection})
-
Creates an SEO-friendly h2 subheading
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- htmlTag → String
-
The semantic HTML tag this text represents
(h1, h2, h3, h4, h5, h6, p, span)
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxLines → int?
-
Maximum lines before truncation
final
- overflow → TextOverflow?
-
Text overflow behavior
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → TextStyle?
-
Text style
final
- text → String
-
The text content
final
- textAlign → TextAlign?
-
Text alignment
final
- textDirection → TextDirection?
-
Text direction
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited