Text class Null safety

A utility widget to print text on screen.

Note that Text widget wraps text in a Span widget.

Text('some text');

// is equivalent to

Span(innerText: 'some text');


Text(String text, {Key? key, String? title, String? style, String? classAttribute, bool? hidden, String? onClickAttribute, EventCallback? onClick})


child Widget?
Single child tag.
final, inherited
children List<Widget>?
Children tags.
final, inherited
classAttribute String?
The classes attribute specifies one or more class names for an dom node.
final, inherited
contenteditable bool?
The contenteditable attribute specifies whether the content of an dom node is editable or not.
final, inherited
correspondingTag DomTagType
Corresponding HTML tag to use to render this widget
read-only, inherited
dataAttributes Map<String, String>?
The data-* attributes is used to store custom data private to the page or application.
final, inherited
draggable bool?
The draggable attribute specifies whether an dom node is draggable or not.
final, inherited
hashCode int
The hash code for this object.
read-only, inherited
hidden bool?
The hidden attribute is a boolean attribute. When present, it specifies that an dom node is not yet, or is no longer, relevant.
final, inherited
id String?
ID of dom node.
final, inherited
initialKey Key
final, inherited
innerText String?
Element's inner text.
final, inherited
onClick EventCallback?
On click event listener.
final, inherited
onClickAttribute String?
onClick raw attribute. for inlined JS callback: onclick="
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
style String?
The style attribute for inline CSS.
final, inherited
tabIndex int?
The tabindex attribute specifies the tab order of an dom node (when the "tab" button is used for navigating).
final, inherited
text String
title String?
The title attribute specifies extra information about an dom node.
final, inherited
widgetCaptureEventListeners Map<DomEventType, EventCallback?>
Events that this widget is listening to in capturing phase.
read-only, inherited
widgetChildren List<Widget>
Child widgets if any.
read-only, inherited
widgetEventListeners Map<DomEventType, EventCallback?>
Events that this widget is listening to.
read-only, inherited
widgetType String
Type of widget.
@nonVirtual, read-only, inherited


createConfiguration() WidgetConfiguration
Create widget's configuration.
createRenderObject(BuildContext context) RenderObject
Called when framework needs a RenderObject for current widget.
isConfigurationChanged(WidgetConfiguration oldConfiguration) bool
Whether configuration has changed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() String
A string representation of this object.


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