PlTextLink class

A link, in a sentence or on its own.

PlTextLink(onPressed: () => open(url), child: const Text('the changelog'))

Everything about it is deliberately smaller than a button. It has no surface, no height of its own and no colour unless asked — what it has is a line under it, which is the one mark a reader already knows means "this goes somewhere".

There is no href, and that is the one real difference from the React build: Flutter has no navigation of its own, so where a link goes is the app's to decide. onPressed is where it is decided.

Inheritance

Constructors

PlTextLink({required Widget child, VoidCallback? onPressed, PlTextLinkUnderline underline = PlTextLinkUnderline.always, PlassColor? color, PlassSize? size, bool external = false, Widget? icon, Widget? startIcon, bool? showIcon, String? externalLabel, FocusNode? focusNode, bool autofocus = false, Key? key})
Creates a link.
const

Properties

autofocus bool
Takes focus as it is inserted into the tree.
final
child Widget
The label.
final
color PlassColor?
Semantic colour role.
final
external bool
Whether the link leaves the app — a browser, another program, a different window.
final
externalLabel String?
What a screen reader hears after the label on an external link. Never drawn.
final
focusNode FocusNode?
Drive focus from outside.
final
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
The mark after the label. Left out, the house glyph is used: the arrow leaving its box when external is on, and the chain otherwise.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPressed VoidCallback?
Called when the link is followed, by pointer or by keyboard.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showIcon bool?
Whether a mark is drawn at all. Left out, it follows external.
final
size PlassSize?
The type scale.
final
startIcon Widget?
A mark before the label — a favicon, a file type, a lock.
final
underline PlTextLinkUnderline
When the underline is drawn.
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